diff options
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a03539f4..336f54342 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,8 +151,13 @@ if(BYN_ENABLE_LTO) endif() if(MSVC) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0") # VS2013 and older explicitly need /arch:sse2 set, VS2015 no longer has that option, but always enabled. - add_compile_flag("/arch:sse2") + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # multi-core build. + add_compile_flag("/MP") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0") + # VS2013 and older explicitly need /arch:sse2 set, VS2015 no longer has that option, but always enabled. + add_compile_flag("/arch:sse2") + endif() endif() add_compile_flag("/std:c++17") # VS2017 generates "error C2429: attribute 'fallthrough' requires compiler flag '/std:c++17'" add_compile_flag("/wd4146") # Ignore warning "warning C4146: unary minus operator applied to unsigned type, result still unsigned", this pattern is used somewhat commonly in the code. @@ -176,9 +181,6 @@ if(MSVC) # Don't warn about using "strdup" as a reserved name. add_compile_flag("/D_CRT_NONSTDC_NO_DEPRECATE") - # multi-core build. - add_compile_flag("/MP") - if(BYN_ENABLE_ASSERTIONS) # On non-Debug builds cmake automatically defines NDEBUG, so we # explicitly undefine it: |