Ver Fonte

Add AppleClang compiler dependency

patrick-mac há 4 anos atrás
pai
commit
b5aaf29678
1 ficheiros alterados com 12 adições e 2 exclusões
  1. 12 2
      CMakeLists.txt

+ 12 - 2
CMakeLists.txt

@@ -18,6 +18,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
     message("${PROJECT_NAME}: Microsoft Visual Studio detected...")
 endif()
 
+if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+    set(APPLE_CLANG_COMPILER TRUE)
+    message("${PROJECT_NAME}: Apple Clang detected...")
+endif()
+
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(GNU_COMPILER TRUE)
     message("${PROJECT_NAME}: GNU Compiler Collection detected...")
@@ -30,12 +35,17 @@ endif()
 message("${PROJECT_NAME}: Setting compiler flags...")
 set(CMAKE_CXX_STANDARD 11)
 
-if(GNU_COMPILER)
+if(MSVC_COMPILER)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 endif()
 
-if(MSVC_COMPILER)
+if(APPLE_CLANG_COMPILER)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endif()
+
+if(GNU_COMPILER)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 endif()