From: Thomas Debesse Date: Tue, 31 Mar 2020 16:48:23 +0000 (+0200) Subject: easy-builder: strip release binaries, support older cmake X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=36e32cbab1a5b89935b7c3c0a68e64a9b70fbd78;p=xonotic%2Fnetradiant.git easy-builder: strip release binaries, support older cmake - use `install/strip` target for release build - CMake used in Ubuntu bionic (currently used to build redistributable packages, old enough to be older than most of the commonly used distributions) does not support -S option yet --- diff --git a/easy-builder b/easy-builder index 983485ae..b360b2db 100755 --- a/easy-builder +++ b/easy-builder @@ -11,6 +11,7 @@ project_source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd build_dir="${project_source_dir}/build${SUBDIR:+/${SUBDIR}}" install_dir="${project_source_dir}/install${SUBDIR:+/${SUBDIR}}" +install_target='install/strip' build_type='Release' declare -a cmake_opts @@ -67,20 +68,21 @@ job_count="${job_count:-4}" declare -a cmake_user_opts while [ ! -z "${1}" ] do - case "${1}" in - '-j'*) - job_count="${1:2}" - shift - ;; - '--debug') - build_type='Debug' - shift - ;; - *) + case "${1}" in + '-j'*) + job_count="${1:2}" + shift + ;; + '--debug') + install_target='install' + build_type='Debug' + shift + ;; + *) cmake_user_opts[${#cmake_user_opts[@]}]="${1}" shift - ;; - esac + ;; + esac done declare -a fetch_submodules_cmd @@ -100,10 +102,11 @@ cmake \ -D'CMAKE_INSTALL_PREFIX'="${install_dir}" \ -D'CMAKE_BUILD_TYPE'="${build_type}" \ "${cmake_opts[@]}" \ - "${cmake_user_opts[@]}" + "${cmake_user_opts[@]}" \ + "${project_source_dir}" cmake \ --build "${build_dir}" \ -- \ -j"${job_count}" \ - install + "${install_target}"