diff --git a/CMakeLists.txt b/CMakeLists.txt index 629b56b..144dace 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -309,7 +309,7 @@ if (UBLOX_GEN_PROTOCOL) -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} - -DOPT_REQUIRE_COMMS_LIB=OFF + -DOPT_REQUIRE_COMMS_LIB=OFF -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ) @@ -382,7 +382,7 @@ if (UBLOX_GEN_TEST) -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_PREFIX_PATH=${combined_prefix_path_str} -DOPT_TEST_OPTIONS=cc_ublox::options::AllMessagesDynMemMsgFactoryDefaultOptions -DOPT_USE_CCACHE=${UBLOX_USE_CCACHE} @@ -446,7 +446,7 @@ if (UBLOX_GEN_TOOLS) -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_PREFIX_PATH=${combined_prefix_path_str} -DOPT_QT_MAJOR_VERSION=${UBLOX_TOOLS_QT_VER} -DOPT_USE_CCACHE=${UBLOX_USE_CCACHE} @@ -510,7 +510,7 @@ if (UBLOX_GEN_SWIG) -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_PREFIX_PATH=${combined_prefix_path_str} -DOPT_SWIG_LANGUAGES=${combined_languages_str} -DOPT_USE_CCACHE=${UBLOX_USE_CCACHE} @@ -581,7 +581,7 @@ if (UBLOX_GEN_EMSCRIPTEN) CMAKE_ARGS -DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DOPT_MODULARIZE=ON -DOPT_EXTRA_INCLUDE_DIRS=${extra_includes_path_str} -DOPT_USE_CCACHE=${UBLOX_USE_CCACHE} diff --git a/script/full_build.sh b/script/full_build.sh new file mode 100755 index 0000000..3f52642 --- /dev/null +++ b/script/full_build.sh @@ -0,0 +1,39 @@ +#!/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 is not provided" + exit 1 +fi + + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT_DIR=$( dirname ${SCRIPT_DIR} ) + +if [ -z ${BUILD_DIR} ]; then + export BUILD_DIR="${ROOT_DIR}/build.full.${CC}.${COMMON_BUILD_TYPE}" +fi + +export COMMON_INSTALL_DIR=${BUILD_DIR}/install +export EXTERNALS_DIR=${ROOT_DIR}/externals +export COMMON_USE_CCACHE=ON +mkdir -p ${BUILD_DIR} + +${SCRIPT_DIR}/prepare_externals.sh + +cd ${BUILD_DIR} +cmake .. -DCMAKE_INSTALL_PREFIX=${COMMON_INSTALL_DIR} \ + -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DUBLOX_GEN_TEST=ON \ + -DUBLOX_GEN_TOOLS=ON -DUBLOX_GEN_SWIG=OFF -DUBLOX_GEN_EMSCRIPTEN=OFF \ + -DUBLOX_BUILD_EXAMPLES=ON -DUBLOX_USE_CCACHE=ON "$@" + +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 f2a61da..5459a67 100755 --- a/script/full_debug_build.sh +++ b/script/full_debug_build.sh @@ -6,29 +6,6 @@ if [ -z "${CC}" -o -z "$CXX" ]; then fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR=$( dirname ${SCRIPT_DIR} ) - -if [ -z ${BUILD_DIR} ]; then - export BUILD_DIR="${ROOT_DIR}/build.full.${CC}" -fi - -export COMMON_INSTALL_DIR=${BUILD_DIR}/install export COMMON_BUILD_TYPE=Debug -export EXTERNALS_DIR=${ROOT_DIR}/externals -export COMMON_USE_CCACHE=ON -mkdir -p ${BUILD_DIR} - -${SCRIPT_DIR}/prepare_externals.sh - -cd ${BUILD_DIR} -cmake .. -DCMAKE_INSTALL_PREFIX=${COMMON_INSTALL_DIR} \ - -DCMAKE_BUILD_TYPE=Debug -DUBLOX_GEN_TEST=ON \ - -DUBLOX_GEN_TOOLS=ON -DUBLOX_GEN_SWIG=OFF -DUBLOX_GEN_EMSCRIPTEN=OFF \ - -DUBLOX_BUILD_EXAMPLES=ON -DUBLOX_USE_CCACHE=ON "$@" - -procs=$(nproc) -if [ -n "${procs}" ]; then - procs_param="--parallel ${procs}" -fi +exec ${SCRIPT_DIR}/full_build.sh "$@" -cmake --build ${BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param} diff --git a/script/full_release_build.sh b/script/full_release_build.sh new file mode 100755 index 0000000..1532649 --- /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_gcc.sh b/script/full_release_build_gcc.sh new file mode 100755 index 0000000..2cbaab1 --- /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 )" +${SCRIPT_DIR}/full_release_build.sh "$@" +