llvm.org GIT mirror llvm / 6f983fe
Updating iOS.cmake to work with the latest Xcode and iOS 8 SDK. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227523 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 4 years ago
1 changed file(s) with 22 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1717 MESSAGE(FATAL_ERROR "SDKROOT env var must be set: " $ENV{SDKROOT})
1818 ENDIF()
1919
20 IF(EXISTS $ENV{SDKROOT})
21 SET(SDKROOT $ENV{SDKROOT})
22 ELSE()
23 execute_process(COMMAND xcodebuild -version -sdk $ENV{SDKROOT} Path
24 OUTPUT_VARIABLE SDKROOT
25 ERROR_QUIET
26 OUTPUT_STRIP_TRAILING_WHITESPACE)
27 ENDIF()
28
2029 IF(NOT CMAKE_C_COMPILER)
21 execute_process(COMMAND xcrun -sdk iphoneos -find clang
30 execute_process(COMMAND xcrun -sdk $ENV{SDKROOT} -find clang
2231 OUTPUT_VARIABLE CMAKE_C_COMPILER
2332 ERROR_QUIET
2433 OUTPUT_STRIP_TRAILING_WHITESPACE)
2635 ENDIF()
2736
2837 IF(NOT CMAKE_CXX_COMPILER)
29 execute_process(COMMAND xcrun -sdk iphoneos -find clang++
38 execute_process(COMMAND xcrun -sdk $ENV{SDKROOT} -find clang++
3039 OUTPUT_VARIABLE CMAKE_CXX_COMPILER
3140 ERROR_QUIET
3241 OUTPUT_STRIP_TRAILING_WHITESPACE)
3342 message(STATUS "Using c compiler ${CMAKE_CXX_COMPILER}")
3443 ENDIF()
3544
45 IF(NOT CMAKE_AR)
46 execute_process(COMMAND xcrun -sdk $ENV{SDKROOT} -find ar
47 OUTPUT_VARIABLE CMAKE_AR_val
48 ERROR_QUIET
49 OUTPUT_STRIP_TRAILING_WHITESPACE)
50 SET(CMAKE_AR ${CMAKE_AR_val} CACHE FILEPATH "Archiver")
51 message(STATUS "Using ar ${CMAKE_AR}")
52 ENDIF()
53
3654 IF (NOT DEFINED IOS_MIN_TARGET)
37 execute_process(COMMAND xcodebuild -sdk iphoneos -version SDKVersion
55 execute_process(COMMAND xcodebuild -sdk $ENV{SDKROOT} -version SDKVersion
3856 OUTPUT_VARIABLE IOS_MIN_TARGET
3957 ERROR_QUIET
4058 OUTPUT_STRIP_TRAILING_WHITESPACE)
4159 ENDIF()
4260
43 SET(IOS_COMMON_FLAGS "-isysroot $ENV{SDKROOT} -mios-version-min=${IOS_MIN_TARGET}")
61 SET(IOS_COMMON_FLAGS "-mios-version-min=${IOS_MIN_TARGET}")
4462 SET(CMAKE_C_FLAGS "${IOS_COMMON_FLAGS}" CACHE STRING "toolchain_cflags" FORCE)
4563 SET(CMAKE_CXX_FLAGS "${IOS_COMMON_FLAGS}" CACHE STRING "toolchain_cxxflags" FORCE)
4664 SET(CMAKE_LINK_FLAGS "${IOS_COMMON_FLAGS}" CACHE STRING "toolchain_linkflags" FORCE)