Skip to content
Snippets Groups Projects
Commit 57aa3118 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Added --with-ci-flags option to build scripts.

parent a4885bf9
No related branches found
No related tags found
1 merge request!48Segments
...@@ -46,7 +46,7 @@ stages: ...@@ -46,7 +46,7 @@ stages:
- export CTEST_OUTPUT_ON_FAILURE=1 - export CTEST_OUTPUT_ON_FAILURE=1
- export CTEST_PARALLEL_LEVEL=4 - export CTEST_PARALLEL_LEVEL=4
# enforce (more or less) warning-free builds # enforce (more or less) warning-free builds
- export CXXFLAGS="-Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=uninitialized -Wno-error=vla" #- export CXXFLAGS="-Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=uninitialized -Wno-error=vla"
- mkdir -p "./builddir/$CI_JOB_NAME" - mkdir -p "./builddir/$CI_JOB_NAME"
- pushd "./builddir/$CI_JOB_NAME" - pushd "./builddir/$CI_JOB_NAME"
- cmake ../.. - cmake ../..
...@@ -64,6 +64,7 @@ stages: ...@@ -64,6 +64,7 @@ stages:
-DWITH_EXAMPLES=${WITH_EXAMPLES} -DWITH_EXAMPLES=${WITH_EXAMPLES}
-DWITH_TOOLS=${WITH_TOOLS} -DWITH_TOOLS=${WITH_TOOLS}
-DWITH_PYTHON=${WITH_PYTHON} -DWITH_PYTHON=${WITH_PYTHON}
-DWITH_CI_FLAGS=yes
# "install" implies the "all" target # "install" implies the "all" target
- ninja ${NINJAFLAGS} install - ninja ${NINJAFLAGS} install
- if [[ ${WITH_TESTS} == "yes" ]]; then - if [[ ${WITH_TESTS} == "yes" ]]; then
......
...@@ -96,6 +96,11 @@ set( CMAKE_SHARED_LINKER_FLAGS "" ) ...@@ -96,6 +96,11 @@ set( CMAKE_SHARED_LINKER_FLAGS "" )
set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "-rdynamic" ) set( CMAKE_SHARED_LINKER_FLAGS_DEBUG "-rdynamic" )
set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "" ) set( CMAKE_SHARED_LINKER_FLAGS_RELEASE "" )
if( ${WITH_CI_FLAGS} )
# enforce (more or less) warning-free builds
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=uninitialized -Wno-error=vla" )
endif()
# set additional Debug/Release options using generator expressions # set additional Debug/Release options using generator expressions
# (that way we can exclude some options for specific targets, see https://stackoverflow.com/a/59734798 for details) # (that way we can exclude some options for specific targets, see https://stackoverflow.com/a/59734798 for details)
add_compile_options( add_compile_options(
......
...@@ -31,6 +31,7 @@ WITH_EXAMPLES="yes" ...@@ -31,6 +31,7 @@ WITH_EXAMPLES="yes"
WITH_PYTHON="yes" WITH_PYTHON="yes"
WITH_TOOLS="yes" WITH_TOOLS="yes"
WITH_BENCHMARKS="yes" WITH_BENCHMARKS="yes"
WITH_CI_FLAGS="no"
for option in "$@" for option in "$@"
do do
...@@ -63,6 +64,7 @@ do ...@@ -63,6 +64,7 @@ do
--with-benchmarks=* ) WITH_BENCHMARKS="${option#*=}" ;; --with-benchmarks=* ) WITH_BENCHMARKS="${option#*=}" ;;
--with-python=* ) WITH_PYTHON="${option#*=}" ;; --with-python=* ) WITH_PYTHON="${option#*=}" ;;
--with-cxx-flags=* ) WITH_CXX_FLAGS="${option#*=}" ;; --with-cxx-flags=* ) WITH_CXX_FLAGS="${option#*=}" ;;
--with-ci-flags=* ) WITH_CI_FLAGS="${option#*=}" ;;
* ) * )
echo "Unknown option ${option}. Use --help for more information." echo "Unknown option ${option}. Use --help for more information."
exit 1 ;; exit 1 ;;
...@@ -93,6 +95,7 @@ if [[ ${HELP} == "yes" ]]; then ...@@ -93,6 +95,7 @@ if [[ ${HELP} == "yes" ]]; then
echo " --with-python=yes/no Compile the Python bindings. '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-benchmarks=yes/no Compile the 'src/Benchmarks' directory. 'yes' by default."
echo " --with-cxx-flags=FLAGS Additional flags for C++ compiler." echo " --with-cxx-flags=FLAGS Additional flags for C++ compiler."
echo " --with-cxx-flags=yes/no Turns on more strict C++ flags for CI. 'no' by default."
echo " --cmake=CMAKE Path to cmake. 'cmake' by default." echo " --cmake=CMAKE Path to cmake. 'cmake' by default."
echo " --verbose It enables verbose build." echo " --verbose It enables verbose build."
echo " --root-dir=PATH Path to the TNL source code root dir." echo " --root-dir=PATH Path to the TNL source code root dir."
...@@ -145,6 +148,7 @@ cmake_command=( ...@@ -145,6 +148,7 @@ cmake_command=(
-DWITH_PYTHON=${WITH_PYTHON} -DWITH_PYTHON=${WITH_PYTHON}
-DWITH_BENCHMARKS=${WITH_BENCHMARKS} -DWITH_BENCHMARKS=${WITH_BENCHMARKS}
-DWITH_CXX_FLAGS=${WITH_CXX_FLAGS} -DWITH_CXX_FLAGS=${WITH_CXX_FLAGS}
-DWITH_CI_FLAGS=${WITH_CI_FLAGS}
-DDCMTK_DIR=${DCMTK_DIR} -DDCMTK_DIR=${DCMTK_DIR}
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment