Explorar o código

Add AppleClang compiler dependency

patrick-mac %!s(int64=4) %!d(string=hai) anos
pai
achega
b5aaf29678
Modificáronse 1 ficheiros con 12 adicións e 2 borrados
  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()