From 89e1113e0cf16be3fddfee4a57324010d0377056 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Jun 2022 12:29:28 -0400 Subject: Xcode: Use ad-hoc signing during compiler id on macOS Xcode 14 no longer accepts an empty signing identity for macOS. However, Xcode in general does not accept an ad-hoc signing identity for iOS. Switch based on the target platform. Fixes: #23609 --- Modules/CMakeDetermineCompilerId.cmake | 2 ++ Modules/CompilerId/Xcode-3.pbxproj.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 916f60c819..0840ff97d4 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -594,6 +594,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT MATCHES "^$|[Mm][Aa][Cc][Oo][Ss]") + set(id_code_sign_identity "-") # When targeting macOS, use only the host architecture. if (_CMAKE_APPLE_ARCHS_DEFAULT) set(id_archs "ARCHS = \"${_CMAKE_APPLE_ARCHS_DEFAULT}\";") @@ -603,6 +604,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_arch_active "ONLY_ACTIVE_ARCH = YES;") endif() else() + set(id_code_sign_identity "") set(id_archs "") set(id_arch_active "ONLY_ACTIVE_ARCH = YES;") endif() diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index aab357a1e9..cca54bc6eb 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -72,7 +72,7 @@ 1DEB928608733DD80010E9CD = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "@id_code_sign_identity@"; PRODUCT_NAME = CompilerId@id_lang@; }; name = Debug; -- cgit v1.2.1 From ab40020b17155a4a78ccfe7bc38efa239c27e38e Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Jun 2022 12:31:51 -0400 Subject: Xcode: Suppress "Run Script" build phase warning during compiler id warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. --- Modules/CompilerId/Xcode-3.pbxproj.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index cca54bc6eb..43e8cc8cb2 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -49,6 +49,7 @@ }; 2C8FEB8E15DC1A1A00E56A5D = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); -- cgit v1.2.1 From 627c08e28bdf35a85b53f8b5fe46de03de80c2fd Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Jun 2022 12:33:55 -0400 Subject: Tests: Teach RunCMake to ignore Xcode DVTSDK warnings On some Xcode versions, `xcodebuild` may warn: ... xcodebuild[...] [MT] DVTSDK: Warning: SDK path collision for path ... Teach RunCMake to drop such incidental lines before matching against expected output. --- Tests/RunCMake/RunCMake.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 02e0decbb2..6bc98f6225 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -156,7 +156,9 @@ function(run_cmake test) "|[^\n]*install_name_tool: warning: changes being made to the file will invalidate the code signature in:" "|[^\n]*xcodebuild[^\n]*DVTPlugInManager" + "|[^\n]*xcodebuild[^\n]*DVTSDK: Warning: SDK path collision for path" "|[^\n]*xcodebuild[^\n]*Requested but did not find extension point with identifier" + "|[^\n]*xcodebuild[^\n]*nil host used in call to allows.*HTTPSCertificateForHost" "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type" "|[^\n]*objc[^\n]*: Class [^\n]* One of the two will be used. Which one is undefined." "|[^\n]*is a member of multiple groups" -- cgit v1.2.1