summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2021-10-06 18:50:12 -0700
committerGitHub <noreply@github.com>2021-10-06 18:50:12 -0700
commitff68bca64cd669aff59c7e1cc0a6677d267a410f (patch)
treedf63bf076a900b033e9e4db8e6b2734ea762c8b4
parent37c35e95b4ead257619cddeb64e44a62aac035f4 (diff)
downloadbinaryen-ff68bca64cd669aff59c7e1cc0a6677d267a410f.tar.gz
binaryen-ff68bca64cd669aff59c7e1cc0a6677d267a410f.tar.bz2
binaryen-ff68bca64cd669aff59c7e1cc0a6677d267a410f.zip
Clean up compile warnings on clang-cl (#4217)
-rw-r--r--CMakeLists.txt12
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: