From 100f2b9b557f89c6b605c82b096731f3be187b3f Mon Sep 17 00:00:00 2001 From: Roelf-Jilling Date: Wed, 14 Nov 2018 21:41:57 +0100 Subject: [PATCH] MSVC flags to Clang-cl; disable c++98-compat and undefined macro warnings (#741) --- tests/CMakeLists.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2d37a51..8781fad 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,7 +34,7 @@ endif() # please try to keep entries ordered =) add_library(gsl_tests_config INTERFACE) target_compile_options(gsl_tests_config INTERFACE - $<$: + $<$,$,$>>: /EHsc /W4 /WX @@ -57,6 +57,11 @@ target_compile_options(gsl_tests_config INTERFACE -Wshadow -Wsign-conversion > + $<$: + -Wno-c++98-compat + -Wno-c++98-compat-pedantic + -Wno-undef + > ) # for tests to find the catch header @@ -122,7 +127,7 @@ endforeach(flag_var) # please try to keep entries ordered =) add_library(gsl_tests_config_noexcept INTERFACE) target_compile_options(gsl_tests_config_noexcept INTERFACE - $<$: + $<$,$,$>>: /D_HAS_EXCEPTIONS=0 /wd4702 /wd4577 @@ -131,8 +136,10 @@ target_compile_options(gsl_tests_config_noexcept INTERFACE > ${GSL_CPLUSPLUS_OPT} $<$>: + $<$,$>>: + -fno-exceptions + > -fno-strict-aliasing - -fno-exceptions -Wall -Wcast-align -Wconversion @@ -148,6 +155,11 @@ target_compile_options(gsl_tests_config_noexcept INTERFACE -Wshadow -Wsign-conversion > + $<$: + -Wno-c++98-compat + -Wno-c++98-compat-pedantic + -Wno-undef + > ) # set definitions for tests