Skip to content

Commit

Permalink
CI: Enable _GLIBCXX_ASSERTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Jun 10, 2020
1 parent eb54eda commit de1d978
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE)
OFF)
endif()
option(WARNINGS_ARE_ERRORS "Treat warnings as errors during compilation" OFF)
option(WITH_GLIBCXX_ASSERTIONS "Enable _GLIBCXX_ASSERTIONS" OFF)
option(WITH_CCACHE "Use ccache compiler invocation." OFF)
option(WITH_PROFILER "Enable profiler annotations." OFF)
set(TEST_TIMEOUT "300" CACHE STRING
Expand Down Expand Up @@ -347,6 +348,7 @@ add_library(cxx_interface INTERFACE)
target_compile_options(
cxx_interface
INTERFACE -Wall -Wextra $<$<BOOL:${WARNINGS_ARE_ERRORS}>:-Werror>
$<$<BOOL:${WITH_GLIBCXX_ASSERTIONS}>:-D_GLIBCXX_ASSERTIONS>
# disable warnings from -Wextra
-Wno-sign-compare -Wno-unused-function -Wno-unused-variable
-Wno-unused-parameter -Wno-missing-braces
Expand Down
6 changes: 6 additions & 0 deletions maintainer/CI/build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ set_default_value make_check_benchmarks false
set_default_value with_cuda false
set_default_value with_cuda_compiler "nvcc"
set_default_value build_type "RelWithAssert"
set_default_value with_glibcxx_assertions true
set_default_value with_ccache false
set_default_value with_scafacos false
set_default_value test_timeout 300
Expand All @@ -118,6 +119,7 @@ cmake_params="${cmake_params} -DTEST_TIMEOUT=${test_timeout}"
if [ "${with_ccache}" = true ]; then
cmake_params="${cmake_params} -DWITH_CCACHE=ON"
fi

if [ "${with_scafacos}" = true ]; then
cmake_params="${cmake_params} -DWITH_SCAFACOS=ON"
fi
Expand All @@ -144,6 +146,10 @@ if [ "${with_static_analysis}" = true ]; then
cmake_params="-DWITH_CLANG_TIDY=ON ${cmake_params}"
fi

if [ "${with_glibcxx_assertions}" = true ] && [ "${build_type}" = "RelWithAssert" ]; then
cmake_params="${cmake_params} -DWITH_GLIBCXX_ASSERTIONS=ON"
fi

if [ "${with_cuda}" = true ]; then
cmake_params="-DWITH_CUDA=ON -DWITH_CUDA_COMPILER=${with_cuda_compiler} ${cmake_params}"
else
Expand Down

0 comments on commit de1d978

Please sign in to comment.