diff options
author | Brad King <brad.king@kitware.com> | 2017-03-31 15:26:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-31 15:26:08 (GMT) |
commit | a1221905092c09603c0b59dd0ed05bfe9f1f22ef (patch) | |
tree | 58a3a7e0fff71f02f09d6b16893bf7f0601ea605 /Modules/CMakeDetermineCompilerId.cmake | |
parent | c791fb12544926bc5870a61735dc2ec62940a6f6 (diff) | |
download | CMake-a1221905092c09603c0b59dd0ed05bfe9f1f22ef.zip CMake-a1221905092c09603c0b59dd0ed05bfe9f1f22ef.tar.gz CMake-a1221905092c09603c0b59dd0ed05bfe9f1f22ef.tar.bz2 |
Xcode: Detect CURRENT_ARCH for use by generator
During compiler identification, extract the Xcode `CURRENT_ARCH` value
and save it for later use by the Xcode generator in an internal compiler
information variable. This will be useful to know the locations of
object files when only one architecture is built.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 1abbc01..687263a 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -104,6 +104,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) + set(CMAKE_${lang}_XCODE_CURRENT_ARCH "${CMAKE_${lang}_XCODE_CURRENT_ARCH}" PARENT_SCOPE) set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_WRAPPER "${CMAKE_${lang}_COMPILER_WRAPPER}" PARENT_SCOPE) @@ -358,6 +359,9 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} endif() endif() endif() + if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CURRENT_ARCH=([^%\r\n]+)[\r\n]") + set(CMAKE_${lang}_XCODE_CURRENT_ARCH "${CMAKE_MATCH_1}" PARENT_SCOPE) + endif() else() execute_process( COMMAND "${CMAKE_${lang}_COMPILER}" |