mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 12:53:55 +08:00
Xcode: Use sysroot and deployment target to identify compiler
Use CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET to set the Xcode SDKROOT and MACOSX_DEPLOYMENT_TARGET build settings. This is necessary because some versions of Xcode select a different compiler based on these settings. We need to make sure the compiler identified during language initialization matches what will be used for the actual build.
This commit is contained in:
@@ -215,6 +215,17 @@ Id flags: ${testflags}
|
||||
else()
|
||||
set(id_toolset "")
|
||||
endif()
|
||||
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(id_deployment_target
|
||||
"MACOSX_DEPLOYMENT_TARGET = \"${CMAKE_OSX_DEPLOYMENT_TARGET}\";")
|
||||
else()
|
||||
set(id_deployment_target "")
|
||||
endif()
|
||||
if(CMAKE_OSX_SYSROOT)
|
||||
set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";")
|
||||
else()
|
||||
set(id_sdkroot "")
|
||||
endif()
|
||||
if(NOT ${XCODE_VERSION} VERSION_LESS 3)
|
||||
set(v 3)
|
||||
set(ext xcodeproj)
|
||||
|
@@ -84,6 +84,8 @@
|
||||
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
|
||||
SYMROOT = .;
|
||||
@id_toolset@
|
||||
@id_deployment_target@
|
||||
@id_sdkroot@
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
Reference in New Issue
Block a user