Files
halx99 5ff6ac07e8 Xcode: Fix target-name embedding overriding code-sign attributes
Multiple targets embedding the same internal framework dependency with
different code-signing attributes should not overwrite each other in the
generated `PBXBuildFile`.  Extend commit 0282429c5a (Xcode: Fix
XCODE_EMBED_FRAMEWORKS when settings differ across targets, 2024-12-02,
v4.0.0-rc1~358^2) to cover target names.

Remove `FileRefToEmbedBuildFileMap` entirely, forcing CMake to
instantiate a brand-new `PBXBuildFile` reference object with a unique
ref value for every separate target embedding action, matching Xcode's
native multi-target configuration behavior.

Fixes: #27850
2026-05-27 11:56:16 -04:00

24 lines
655 B
CMake

cmake_policy(VERSION 3.1...3.20)
function(findAttribute project attr expectPresent)
set(expectCount ${ARGV3})
if(NOT expectPresent)
set(expectCount 0)
endif()
execute_process(
COMMAND grep -c ${attr} ${RunCMake_TEST_BINARY_DIR}/${project}.xcodeproj/project.pbxproj
OUTPUT_VARIABLE actualCount
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT actualCount MATCHES "^[0-9]+$")
set(actualCount 0)
endif()
if(NOT ("${expectCount}" STREQUAL "") AND NOT (actualCount EQUAL expectCount))
set(RunCMake_TEST_FAILED "${attr} expected ${expectCount} matches, but found ${actualCount}" PARENT_SCOPE)
endif()
endfunction()