Add support for compiling with clang-cl. (#286)
diff --git a/scripts/cmake/common.cmake b/scripts/cmake/common.cmake
index 3578be1..c62b9a0 100644
--- a/scripts/cmake/common.cmake
+++ b/scripts/cmake/common.cmake
@@ -72,10 +72,14 @@
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compiler_flags(-Werror)
- add_compiler_flags(-pedantic)
- add_compiler_flags(-pedantic-errors)
- add_compiler_flags(-fvisibility=hidden)
add_compiler_flags(-fstrict-aliasing)
+
+ # The following options are not valid when clang-cl is used.
+ if(NOT MSVC)
+ add_compiler_flags(-pedantic)
+ add_compiler_flags(-pedantic-errors)
+ add_compiler_flags(-fvisibility=hidden)
+ endif()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")