瀏覽代碼

OS X: Use -iframework with AppleClang only on version >= 4.2

Since commit v3.1.0-rc1~564^2 (OS X: Use -iframework for system
framework directories, 2014-05-05) we test the version of Clang to see
if it supports -iframework.  Fix the version test used for AppleClang
since it uses a different version scheme than upstream Clang.
Brad King 10 年之前
父節點
當前提交
e68f0cb3d4
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. 5 0
      Modules/Platform/Darwin-AppleClang-C.cmake
  2. 5 0
      Modules/Platform/Darwin-AppleClang-CXX.cmake

+ 5 - 0
Modules/Platform/Darwin-AppleClang-C.cmake

@@ -1 +1,6 @@
 include(Platform/Darwin-Clang-C)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2)
+  set(CMAKE_C_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ")
+else()
+  unset(CMAKE_C_SYSTEM_FRAMEWORK_SEARCH_FLAG)
+endif()

+ 5 - 0
Modules/Platform/Darwin-AppleClang-CXX.cmake

@@ -1 +1,6 @@
 include(Platform/Darwin-Clang-CXX)
+if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2)
+  set(CMAKE_CXX_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ")
+else()
+  unset(CMAKE_CXX_SYSTEM_FRAMEWORK_SEARCH_FLAG)
+endif()