diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2021-02-26 12:48:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-26 12:48:33 -0800 |
commit | f2adf69b7c364b45f75c3b5027d8a24213fd4001 (patch) | |
tree | 041ed83754893e9d465d0b38f6c7b5af2e4a77ee /test/unit/CMakeLists.txt | |
parent | 0b9fe94d346b7448a0e092cc9f43013aadfe9548 (diff) |
Fix -Werror issues with clang and use clang for debug-cln build. (#6004)
This fixes some issues that break the nightly ASAN builds with clang.
Diffstat (limited to 'test/unit/CMakeLists.txt')
-rw-r--r-- | test/unit/CMakeLists.txt | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index a6291178b..46ff346e0 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -57,6 +57,11 @@ macro(cvc4_add_unit_test is_white name output_dir) if(${is_white}) target_compile_options(${name} PRIVATE -fno-access-control) endif() + # Disable the Wunused-comparison warnings for the unit tests. + check_cxx_compiler_flag("-Wno-unused-comparison" HAVE_FLAGWno_unused_comparison) + if(HAVE_FLAGWno_unused_comparison) + target_compile_options(${name} PRIVATE -Wno-unused-comparison) + endif() add_dependencies(build-units ${name}) # Generate into bin/test/unit/<output_dir>. set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/unit/${output_dir}) @@ -125,7 +130,16 @@ macro(cvc4_add_cxx_unit_test is_white name output_dir) endif() # Disable the Wsuggest-override warnings for the unit tests. CxxTest generates # code that does not properly add the override keyword to runTest(). - target_compile_options(${name} PRIVATE -Wno-suggest-override) + check_cxx_compiler_flag("-Wno-suggest-override" HAVE_FLAGWno_suggest_override) + if(HAVE_FLAGWno_suggest_override) + target_compile_options(${name} PRIVATE -Wno-suggest-override) + endif() + # Disable the Wunused-comparison warnings for the unit tests. + check_cxx_compiler_flag("-Wno-unused-comparison" HAVE_FLAGWno_unused_comparison) + if(HAVE_FLAGWno_unused_comparison) + target_compile_options(${name} PRIVATE -Wno-unused-comparison) + endif() + add_dependencies(build-units ${name}) # Generate into bin/test/unit/<output_dir>. set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/unit/${output_dir}) |