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:
Brad King committed 2014-04-29 09:36:15 -04:00
1 parent 0200d0a9c4
commit 0cce556b5f
2 files changed
+13

No files matched your search

+11
View File
@@ -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)
+2
View File
@@ -84,6 +84,8 @@
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
SYMROOT = .;
@id_toolset@
@id_deployment_target@
@id_sdkroot@
};
name = Debug;
};