aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/platforms/iOS.cmake
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-04-10 21:22:52 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-10 21:23:04 +0000
commit31195f0bdca6ee2a5e72d07edf13e1d81206d949 (patch)
tree1b2c9792582e12f5af0b1512e3094425f0dc0df9 /cmake/platforms/iOS.cmake
parentc75239e6119d0f9a74c57099d91cbc9bde56bf33 (diff)
parent4c5e43da7792f75567b693105cc53e3f1992ad98 (diff)
downloadexternal_llvm-31195f0bdca6ee2a5e72d07edf13e1d81206d949.zip
external_llvm-31195f0bdca6ee2a5e72d07edf13e1d81206d949.tar.gz
external_llvm-31195f0bdca6ee2a5e72d07edf13e1d81206d949.tar.bz2
Merge "Update aosp/master llvm for rebase to r233350"
Diffstat (limited to 'cmake/platforms/iOS.cmake')
-rw-r--r--cmake/platforms/iOS.cmake32
1 files changed, 23 insertions, 9 deletions
diff --git a/cmake/platforms/iOS.cmake b/cmake/platforms/iOS.cmake
index e18ca6b..4914059 100644
--- a/cmake/platforms/iOS.cmake
+++ b/cmake/platforms/iOS.cmake
@@ -15,11 +15,10 @@ SET(CMAKE_C_COMPILER_WORKS True)
SET(DARWIN_TARGET_OS_NAME ios)
IF(NOT DEFINED ENV{SDKROOT})
- MESSAGE(FATAL_ERROR "SDKROOT env var must be set: " $ENV{SDKROOT})
-ENDIF()
-
-IF(EXISTS $ENV{SDKROOT})
- SET(SDKROOT $ENV{SDKROOT})
+ execute_process(COMMAND xcodebuild -version -sdk iphoneos Path
+ OUTPUT_VARIABLE SDKROOT
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE()
execute_process(COMMAND xcodebuild -version -sdk $ENV{SDKROOT} Path
OUTPUT_VARIABLE SDKROOT
@@ -27,8 +26,14 @@ ELSE()
OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDIF()
+IF(NOT EXISTS ${SDKROOT})
+ MESSAGE(FATAL_ERROR "SDKROOT could not be detected!")
+ENDIF()
+
+set(CMAKE_OSX_SYSROOT ${SDKROOT})
+
IF(NOT CMAKE_C_COMPILER)
- execute_process(COMMAND xcrun -sdk $ENV{SDKROOT} -find clang
+ execute_process(COMMAND xcrun -sdk ${SDKROOT} -find clang
OUTPUT_VARIABLE CMAKE_C_COMPILER
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -36,7 +41,7 @@ IF(NOT CMAKE_C_COMPILER)
ENDIF()
IF(NOT CMAKE_CXX_COMPILER)
- execute_process(COMMAND xcrun -sdk $ENV{SDKROOT} -find clang++
+ execute_process(COMMAND xcrun -sdk ${SDKROOT} -find clang++
OUTPUT_VARIABLE CMAKE_CXX_COMPILER
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -44,7 +49,7 @@ IF(NOT CMAKE_CXX_COMPILER)
ENDIF()
IF(NOT CMAKE_AR)
- execute_process(COMMAND xcrun -sdk $ENV{SDKROOT} -find ar
+ execute_process(COMMAND xcrun -sdk ${SDKROOT} -find ar
OUTPUT_VARIABLE CMAKE_AR_val
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -52,8 +57,17 @@ IF(NOT CMAKE_AR)
message(STATUS "Using ar ${CMAKE_AR}")
ENDIF()
+IF(NOT CMAKE_RANLIB)
+ execute_process(COMMAND xcrun -sdk ${SDKROOT} -find ranlib
+ OUTPUT_VARIABLE CMAKE_RANLIB_val
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ SET(CMAKE_RANLIB ${CMAKE_RANLIB_val} CACHE FILEPATH "Ranlib")
+ message(STATUS "Using ranlib ${CMAKE_RANLIB}")
+ENDIF()
+
IF (NOT DEFINED IOS_MIN_TARGET)
-execute_process(COMMAND xcodebuild -sdk $ENV{SDKROOT} -version SDKVersion
+execute_process(COMMAND xcodebuild -sdk ${SDKROOT} -version SDKVersion
OUTPUT_VARIABLE IOS_MIN_TARGET
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)