From ba7b368151559d89f5eccb9e604e3e9d8314e0fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Oberhuber?= <oberhuber.tomas@gmail.com> Date: Sun, 19 Jan 2020 20:33:19 +0100 Subject: [PATCH] Added command line argument --with-cxx-flags to build script. --- CMakeLists.txt | 2 +- build | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68252ba6a7..7d1666163b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON ) set( CMAKE_CXX_EXTENSIONS OFF ) # set default build options -set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas" ) +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WITH_CXX_FLAGS} -pthread -Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas" ) set( CMAKE_CXX_FLAGS_DEBUG "-g" ) set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" ) # pass -rdynamic only in Debug mode diff --git a/build b/build index 67492f02c3..9deb12d10a 100755 --- a/build +++ b/build @@ -62,6 +62,7 @@ do --with-tools=* ) WITH_TOOLS="${option#*=}" ;; --with-benchmarks=* ) WITH_BENCHMARKS="${option#*=}" ;; --with-python=* ) WITH_PYTHON="${option#*=}" ;; + --with-cxx-flags=* ) WITH_CXX_FLAGS="${option#*=}" ;; * ) echo "Unknown option ${option}. Use --help for more information." exit 1 ;; @@ -91,6 +92,7 @@ if [[ ${HELP} == "yes" ]]; then echo " --with-tools=yes/no Compile the 'src/Tools' directory. 'yes' by default." echo " --with-python=yes/no Compile the Python bindings. 'yes' by default." echo " --with-benchmarks=yes/no Compile the 'src/Benchmarks' directory. 'yes' by default." + echo " --with-cxx-flags=FLAGS Additional flags for C++ compiler." echo " --cmake=CMAKE Path to cmake. 'cmake' by default." echo " --verbose It enables verbose build." echo " --root-dir=PATH Path to the TNL source code root dir." @@ -142,6 +144,7 @@ cmake_command=( -DWITH_TOOLS=${WITH_TOOLS} -DWITH_PYTHON=${WITH_PYTHON} -DWITH_BENCHMARKS=${WITH_BENCHMARKS} + -DWITH_CXX_FLAGS=${WITH_CXX_FLAGS} -DDCMTK_DIR=${DCMTK_DIR} ) -- GitLab