diff --git a/script/env_dev_clang.sh b/script/env_dev_clang.sh index c9e59f97..c5d020b2 100755 --- a/script/env_dev_clang.sh +++ b/script/env_dev_clang.sh @@ -1,7 +1,12 @@ #!/bin/bash -export CC=clang -export CXX=clang++ +if [ -z "${CC}" ]; then + export CC=clang +fi + +if [ -z "${CXX}" ]; then + export CXX=clang++ +fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source ${SCRIPT_DIR}/env_dev.sh "$@" diff --git a/script/env_dev_size_gcc.sh b/script/env_dev_size_gcc.sh index 9a6c652a..78212bba 100755 --- a/script/env_dev_size_gcc.sh +++ b/script/env_dev_size_gcc.sh @@ -1,7 +1,12 @@ #!/bin/bash -export CC=gcc -export CXX=g++ +if [ -z "${CC}" ]; then + export CC=gcc +fi + +if [ -z "${CXX}" ]; then + export CXX=g++ +fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source ${SCRIPT_DIR}/env_dev_size.sh "$@" diff --git a/script/full_build.sh b/script/full_build.sh new file mode 100755 index 00000000..2ff315d0 --- /dev/null +++ b/script/full_build.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ -z "${CC}" -o -z "$CXX" ]; then + echo "ERROR: Compilers are not provided" + exit 1 +fi + +if [ -z "${COMMON_BUILD_TYPE}" ]; then + echo "ERROR: Build type not provided" + exit 1 +fi + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT_DIR=$( dirname ${SCRIPT_DIR} ) +export BUILD_DIR="${ROOT_DIR}/build.full.${CC}.${COMMON_BUILD_TYPE}" +export COMMON_INSTALL_DIR=${BUILD_DIR}/install +export EXTERNALS_DIR=${ROOT_DIR}/externals +mkdir -p ${BUILD_DIR} + +${SCRIPT_DIR}/prepare_externals.sh + +source ${SCRIPT_DIR}/env_dev.sh "$@" + +procs=$(nproc) +if [ -n "${procs}" ]; then + procs_param="--parallel ${procs}" +fi + +cmake --build ${BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param} diff --git a/script/full_debug_build.sh b/script/full_debug_build.sh index ab339013..7b74d0eb 100755 --- a/script/full_debug_build.sh +++ b/script/full_debug_build.sh @@ -6,20 +6,6 @@ if [ -z "${CC}" -o -z "$CXX" ]; then fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR=$( dirname ${SCRIPT_DIR} ) -export BUILD_DIR="${ROOT_DIR}/build.full.${CC}" -export COMMON_INSTALL_DIR=${BUILD_DIR}/install export COMMON_BUILD_TYPE=Debug -export EXTERNALS_DIR=${ROOT_DIR}/externals -mkdir -p ${BUILD_DIR} +exec ${SCRIPT_DIR}/full_build.sh -${SCRIPT_DIR}/prepare_externals.sh - -source ${SCRIPT_DIR}/env_dev.sh "$@" - -procs=$(nproc) -if [ -n "${procs}" ]; then - procs_param="--parallel ${procs}" -fi - -cmake --build ${BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param} diff --git a/script/full_debug_build_clang.sh b/script/full_debug_build_clang.sh index fc808781..319ebab1 100755 --- a/script/full_debug_build_clang.sh +++ b/script/full_debug_build_clang.sh @@ -1,8 +1,13 @@ #!/bin/bash -export CC=clang -export CXX=clang++ +if [ -z "${CC}" ]; then + export CC=clang +fi + +if [ -z "${CXX}" ]; then + export CXX=clang++ +fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -${SCRIPT_DIR}/full_debug_build.sh "$@" +exec ${SCRIPT_DIR}/full_debug_build.sh "$@" diff --git a/script/full_debug_build_gcc.sh b/script/full_debug_build_gcc.sh index 10191349..6545627b 100755 --- a/script/full_debug_build_gcc.sh +++ b/script/full_debug_build_gcc.sh @@ -1,8 +1,13 @@ #!/bin/bash -export CC=gcc -export CXX=g++ +if [ -z "${CC}" ]; then + export CC=gcc +fi + +if [ -z "${CXX}" ]; then + export CXX=g++ +fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -${SCRIPT_DIR}/full_debug_build.sh "$@" +exec ${SCRIPT_DIR}/full_debug_build.sh "$@" diff --git a/script/full_release_build.sh b/script/full_release_build.sh new file mode 100755 index 00000000..ea8503dc --- /dev/null +++ b/script/full_release_build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ -z "${CC}" -o -z "$CXX" ]; then + echo "ERROR: Compilers are not provided" + exit 1 +fi + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +export COMMON_BUILD_TYPE=Release +exec ${SCRIPT_DIR}/full_build.sh + diff --git a/script/full_release_build_clang.sh b/script/full_release_build_clang.sh new file mode 100755 index 00000000..f9e18627 --- /dev/null +++ b/script/full_release_build_clang.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ -z "${CC}" ]; then + export CC=clang +fi + +if [ -z "${CXX}" ]; then + export CXX=clang++ +fi + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +exec ${SCRIPT_DIR}/full_release_build.sh "$@" + diff --git a/script/full_release_build_gcc.sh b/script/full_release_build_gcc.sh new file mode 100755 index 00000000..f877f3c7 --- /dev/null +++ b/script/full_release_build_gcc.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ -z "${CC}" ]; then + export CC=gcc +fi + +if [ -z "${CXX}" ]; then + export CXX=g++ +fi + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +exec ${SCRIPT_DIR}/full_release_build.sh "$@" +