Browse Source

Use "better" compiler checks

Apparently the MSVC variable is preferred. And apparently if is weird
about strings.
Bart van Strien 6 years ago
parent
commit
25c4bb99dc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/CMakeLists.txt

+ 2 - 2
src/CMakeLists.txt

@@ -10,9 +10,9 @@ include_directories (
 )
 
 ### Compiler-specific flags
-if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
+if (MSVC)
 	set (DLLEXPORT "__declspec(dllexport)")
-elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
 	set (DLLEXPORT "__attribute__((visibility(\"default\")))")
 	add_compile_options ("-fvisibility=hidden")
 	add_link_options ("-fvisibility=hidden")