Просмотр исходного кода

Xcode: Fix compiler id detection when code signing is required

The iOS product type 'com.apple.package-type.bundle.unit-test' requires
code signing on Xcode 6.  Other iOS target types do too.  Until CMake
learns to add the CODE_SIGN_IDENTITY build attribute itself, toolchain
files can set CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY to tell the Xcode
generator to add the attribute.  Teach CMakeDetermineCompilerId to
recognize this variable and add the CODE_SIGN_IDENTITY build attribute
to the compiler id project.
Brad King 11 лет назад
Родитель
Сommit
b91020f659
2 измененных файлов с 6 добавлено и 0 удалено
  1. 5 0
      Modules/CMakeDetermineCompilerId.cmake
  2. 1 0
      Modules/CompilerId/Xcode-3.pbxproj.in

+ 5 - 0
Modules/CMakeDetermineCompilerId.cmake

@@ -270,6 +270,11 @@ Id flags: ${testflags}
     else()
       set(id_sdkroot "")
     endif()
+    if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY)
+      set(id_code_sign_identity "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";")
+    else()
+      set(id_code_sign_identity "")
+    endif()
     if(NOT ${XCODE_VERSION} VERSION_LESS 3)
       set(v 3)
       set(ext xcodeproj)

+ 1 - 0
Modules/CompilerId/Xcode-3.pbxproj.in

@@ -81,6 +81,7 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				ONLY_ACTIVE_ARCH = YES;
+				@id_code_sign_identity@
 				CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
 				SYMROOT = .;
 				@id_toolset@