mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
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
24 lines
655 B
CMake
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()
|