diff options
author | Derek Schuff <dschuff@chromium.org> | 2019-11-06 16:08:27 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-06 16:08:27 -0800 |
commit | 8a5040e19b7c1c4a56a4a12b6d2cb0ff85e8e3ed (patch) | |
tree | 56a54ee96fa2f7ede56e78f1a6f90adf80c54f53 /CMakeLists.txt | |
parent | a79d64327b480f63fa28a5e239b98ce64ebbe9b9 (diff) | |
download | wabt-8a5040e19b7c1c4a56a4a12b6d2cb0ff85e8e3ed.tar.gz wabt-8a5040e19b7c1c4a56a4a12b6d2cb0ff85e8e3ed.tar.bz2 wabt-8a5040e19b7c1c4a56a4a12b6d2cb0ff85e8e3ed.zip |
Check for MSVC first in list of compiler tests (#1209)
This allows use of clang-cl.exe, wherin Clang pretends to be MSVC and accepts its flags.
It will be treated as MSVC in this case.
There are a few places where we'll want to tune further, and perhaps refactor to allow a compiler to be both MSVC and clang, or perhaps use clang's flags instead of MSVC's. But this gets things working.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e4fea6a..451a8a6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,11 @@ option(CODE_COVERAGE "Build with code coverage enabled" OFF) option(WITH_EXCEPTIONS "Build with exceptions enabled" OFF) option(WERROR "Build with warnings as errors" OFF) -if (CMAKE_C_COMPILER_ID MATCHES "Clang") +if (MSVC) + set(COMPILER_IS_CLANG 0) + set(COMPILER_IS_GNU 0) + set(COMPILER_IS_MSVC 1) +elseif (CMAKE_C_COMPILER_ID MATCHES "Clang") set(COMPILER_IS_CLANG 1) set(COMPILER_IS_GNU 0) set(COMPILER_IS_MSVC 0) @@ -36,10 +40,6 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") set(COMPILER_IS_CLANG 0) set(COMPILER_IS_GNU 1) set(COMPILER_IS_MSVC 0) -elseif (MSVC) - set(COMPILER_IS_CLANG 0) - set(COMPILER_IS_GNU 0) - set(COMPILER_IS_MSVC 1) elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") set(COMPILER_IS_CLANG 1) set(COMPILER_IS_GNU 0) |