[test-suite] r267205 - Add new cmake caches for iOS setups

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 13:09:52 PDT 2016


Author: matze
Date: Fri Apr 22 15:09:51 2016
New Revision: 267205

URL: http://llvm.org/viewvc/llvm-project?rev=267205&view=rev
Log:
Add new cmake caches for iOS setups

These are similar in spirit like iOS.cmake from the llvm repository. The
main difference is that the caches here set -ccc-install-dir which is
important when you want to test a compiler which has been compiled
independently of the rest of the iOS SDK.

Added:
    test-suite/trunk/cmake/caches/target-arm64-ios.cmake
    test-suite/trunk/cmake/caches/target-haswell.cmake
    test-suite/trunk/cmake/caches/target-thumbv7s-ios.cmake
    test-suite/trunk/cmake/caches/util/
    test-suite/trunk/cmake/caches/util/arch_flags.cmake
    test-suite/trunk/cmake/caches/util/xcode_sdk.cmake
Removed:
    test-suite/trunk/cmake/caches/Release_Haswell.cmake

Removed: test-suite/trunk/cmake/caches/Release_Haswell.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/caches/Release_Haswell.cmake?rev=267204&view=auto
==============================================================================
--- test-suite/trunk/cmake/caches/Release_Haswell.cmake (original)
+++ test-suite/trunk/cmake/caches/Release_Haswell.cmake (removed)
@@ -1,2 +0,0 @@
-set(OPTFLAGS "${OPTFLAGS} -march=haswell")
-include(${CMAKE_CURRENT_LIST_DIR}/Release.cmake)

Added: test-suite/trunk/cmake/caches/target-arm64-ios.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/caches/target-arm64-ios.cmake?rev=267205&view=auto
==============================================================================
--- test-suite/trunk/cmake/caches/target-arm64-ios.cmake (added)
+++ test-suite/trunk/cmake/caches/target-arm64-ios.cmake Fri Apr 22 15:09:51 2016
@@ -0,0 +1,3 @@
+set(XCRUN_FLAGS --toolchain iOS --sdk iphoneos)
+set(ARCH_FLAGS "${ARCH_FLAGS} -arch arm64")
+include(${CMAKE_CURRENT_LIST_DIR}/util/xcode_sdk.cmake)

Added: test-suite/trunk/cmake/caches/target-haswell.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/caches/target-haswell.cmake?rev=267205&view=auto
==============================================================================
--- test-suite/trunk/cmake/caches/target-haswell.cmake (added)
+++ test-suite/trunk/cmake/caches/target-haswell.cmake Fri Apr 22 15:09:51 2016
@@ -0,0 +1,2 @@
+set(ARCH_FLAGS "-march=haswell")
+include(${CMAKE_CURRENT_LIST_DIR}/util/arch_flags.cmake)

Added: test-suite/trunk/cmake/caches/target-thumbv7s-ios.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/caches/target-thumbv7s-ios.cmake?rev=267205&view=auto
==============================================================================
--- test-suite/trunk/cmake/caches/target-thumbv7s-ios.cmake (added)
+++ test-suite/trunk/cmake/caches/target-thumbv7s-ios.cmake Fri Apr 22 15:09:51 2016
@@ -0,0 +1,3 @@
+set(XCRUN_FLAGS --toolchain iOS --sdk iphoneos)
+set(ARCH_FLAGS "${ARCH_FLAGS} -arch thumbv7s")
+include(${CMAKE_CURRENT_LIST_DIR}/util/xcode_sdk.cmake)

Added: test-suite/trunk/cmake/caches/util/arch_flags.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/caches/util/arch_flags.cmake?rev=267205&view=auto
==============================================================================
--- test-suite/trunk/cmake/caches/util/arch_flags.cmake (added)
+++ test-suite/trunk/cmake/caches/util/arch_flags.cmake Fri Apr 22 15:09:51 2016
@@ -0,0 +1,4 @@
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAGS}" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAGS}" CACHE STRING "")
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${ARCH_FLAGS}" CACHE STRING "")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ARCH_FLAGS}" CACHE STRING "")

Added: test-suite/trunk/cmake/caches/util/xcode_sdk.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/caches/util/xcode_sdk.cmake?rev=267205&view=auto
==============================================================================
--- test-suite/trunk/cmake/caches/util/xcode_sdk.cmake (added)
+++ test-suite/trunk/cmake/caches/util/xcode_sdk.cmake Fri Apr 22 15:09:51 2016
@@ -0,0 +1,30 @@
+execute_process(COMMAND xcrun ${XCRUN_FLAGS} --show-sdk-path
+                OUTPUT_STRIP_TRAILING_WHITESPACE
+                OUTPUT_VARIABLE SDK_PATH)
+execute_process(COMMAND xcrun ${XCRUN_FLAGS} -f ld
+                OUTPUT_STRIP_TRAILING_WHITESPACE
+                OUTPUT_VARIABLE LINKER_PATH)
+get_filename_component(LINKER_DIR ${LINKER_PATH} DIRECTORY)
+execute_process(COMMAND xcrun ${XCRUN_FLAGS} -f ranlib
+                OUTPUT_STRIP_TRAILING_WHITESPACE
+                OUTPUT_VARIABLE CMAKE_RANLIB)
+set(CMAKE_RANLIB "${CMAKE_RANLIB}" CACHE STRING "")
+execute_process(COMMAND xcrun ${XCRUN_FLAGS} -f ar
+                OUTPUT_STRIP_TRAILING_WHITESPACE
+                OUTPUT_VARIABLE CMAKE_AR)
+set(CMAKE_AR "${CMAKE_AR}" CACHE STRING "")
+execute_process(COMMAND xcrun ${XCRUN_FLAGS} -f strip
+                OUTPUT_STRIP_TRAILING_WHITESPACE
+                OUTPUT_VARIABLE CMAKE_STRIP)
+set(CMAKE_STRIP "${CMAKE_STRIP}" CACHE STRING "")
+execute_process(COMMAND xcrun ${XCRUN_FLAGS} -f nm
+                OUTPUT_STRIP_TRAILING_WHITESPACE
+                OUTPUT_VARIABLE CMAKE_NM)
+set(CMAKE_NM "${CMAKE_NM}" CACHE STRING "")
+# I couldn't find a way to stop cmake from adding a -isysroot, at least make it
+# add the correct path
+set(CMAKE_OSX_SYSROOT "${SDK_PATH}" CACHE STRING "")
+
+set(ARCH_FLAGS "${ARCH_FLAGS} --sysroot ${SDK_PATH}")
+set(ARCH_FLAGS "${ARCH_FLAGS} -ccc-install-dir ${LINKER_DIR}")
+include(${CMAKE_CURRENT_LIST_DIR}/arch_flags.cmake)




More information about the llvm-commits mailing list