mirror of
https://github.com/microsoft/GSL.git
synced 2025-01-31 07:45:01 -05:00
MSVC flags to Clang-cl; disable c++98-compat and undefined macro warnings (#741)
This commit is contained in:
parent
84f57949ab
commit
100f2b9b55
@ -34,7 +34,7 @@ endif()
|
||||
# please try to keep entries ordered =)
|
||||
add_library(gsl_tests_config INTERFACE)
|
||||
target_compile_options(gsl_tests_config INTERFACE
|
||||
$<$<CXX_COMPILER_ID:MSVC>:
|
||||
$<$<AND:$<PLATFORM_ID:Windows>,$<OR:$<CXX_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:Clang>>>:
|
||||
/EHsc
|
||||
/W4
|
||||
/WX
|
||||
@ -57,6 +57,11 @@ target_compile_options(gsl_tests_config INTERFACE
|
||||
-Wshadow
|
||||
-Wsign-conversion
|
||||
>
|
||||
$<$<CXX_COMPILER_ID:Clang>:
|
||||
-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
|
||||
$<$<CXX_COMPILER_ID:MSVC>:
|
||||
$<$<AND:$<PLATFORM_ID:Windows>,$<OR:$<CXX_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:Clang>>>:
|
||||
/D_HAS_EXCEPTIONS=0
|
||||
/wd4702
|
||||
/wd4577
|
||||
@ -131,8 +136,10 @@ target_compile_options(gsl_tests_config_noexcept INTERFACE
|
||||
>
|
||||
${GSL_CPLUSPLUS_OPT}
|
||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:
|
||||
-fno-strict-aliasing
|
||||
$<$<NOT:$<AND:$<PLATFORM_ID:Windows>,$<CXX_COMPILER_ID:Clang>>>:
|
||||
-fno-exceptions
|
||||
>
|
||||
-fno-strict-aliasing
|
||||
-Wall
|
||||
-Wcast-align
|
||||
-Wconversion
|
||||
@ -148,6 +155,11 @@ target_compile_options(gsl_tests_config_noexcept INTERFACE
|
||||
-Wshadow
|
||||
-Wsign-conversion
|
||||
>
|
||||
$<$<CXX_COMPILER_ID:Clang>:
|
||||
-Wno-c++98-compat
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-undef
|
||||
>
|
||||
)
|
||||
|
||||
# set definitions for tests
|
||||
|
Loading…
Reference in New Issue
Block a user