mirror of
https://github.com/microsoft/GSL.git
synced 2025-01-31 15:55:02 -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 =)
|
# please try to keep entries ordered =)
|
||||||
add_library(gsl_tests_config INTERFACE)
|
add_library(gsl_tests_config INTERFACE)
|
||||||
target_compile_options(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
|
/EHsc
|
||||||
/W4
|
/W4
|
||||||
/WX
|
/WX
|
||||||
@ -57,6 +57,11 @@ target_compile_options(gsl_tests_config INTERFACE
|
|||||||
-Wshadow
|
-Wshadow
|
||||||
-Wsign-conversion
|
-Wsign-conversion
|
||||||
>
|
>
|
||||||
|
$<$<CXX_COMPILER_ID:Clang>:
|
||||||
|
-Wno-c++98-compat
|
||||||
|
-Wno-c++98-compat-pedantic
|
||||||
|
-Wno-undef
|
||||||
|
>
|
||||||
)
|
)
|
||||||
|
|
||||||
# for tests to find the catch header
|
# for tests to find the catch header
|
||||||
@ -122,7 +127,7 @@ endforeach(flag_var)
|
|||||||
# please try to keep entries ordered =)
|
# please try to keep entries ordered =)
|
||||||
add_library(gsl_tests_config_noexcept INTERFACE)
|
add_library(gsl_tests_config_noexcept INTERFACE)
|
||||||
target_compile_options(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
|
/D_HAS_EXCEPTIONS=0
|
||||||
/wd4702
|
/wd4702
|
||||||
/wd4577
|
/wd4577
|
||||||
@ -131,8 +136,10 @@ target_compile_options(gsl_tests_config_noexcept INTERFACE
|
|||||||
>
|
>
|
||||||
${GSL_CPLUSPLUS_OPT}
|
${GSL_CPLUSPLUS_OPT}
|
||||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:
|
||||||
-fno-strict-aliasing
|
$<$<NOT:$<AND:$<PLATFORM_ID:Windows>,$<CXX_COMPILER_ID:Clang>>>:
|
||||||
-fno-exceptions
|
-fno-exceptions
|
||||||
|
>
|
||||||
|
-fno-strict-aliasing
|
||||||
-Wall
|
-Wall
|
||||||
-Wcast-align
|
-Wcast-align
|
||||||
-Wconversion
|
-Wconversion
|
||||||
@ -148,6 +155,11 @@ target_compile_options(gsl_tests_config_noexcept INTERFACE
|
|||||||
-Wshadow
|
-Wshadow
|
||||||
-Wsign-conversion
|
-Wsign-conversion
|
||||||
>
|
>
|
||||||
|
$<$<CXX_COMPILER_ID:Clang>:
|
||||||
|
-Wno-c++98-compat
|
||||||
|
-Wno-c++98-compat-pedantic
|
||||||
|
-Wno-undef
|
||||||
|
>
|
||||||
)
|
)
|
||||||
|
|
||||||
# set definitions for tests
|
# set definitions for tests
|
||||||
|
Loading…
Reference in New Issue
Block a user