Files
cmake/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksMultiTargets.cmake
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

21 lines
544 B
CMake

set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
add_library(MTestLib SHARED TestLib/TestLib.c TestLib/TestLib.h)
set_target_properties(MTestLib PROPERTIES
FRAMEWORK 1
PUBLIC_HEADER TestLib/TestLib.h
)
add_executable(mapp1 MACOSX_BUNDLE main.m)
add_executable(mapp2 MACOSX_BUNDLE main.m)
set_target_properties(mapp1 PROPERTIES
XCODE_EMBED_FRAMEWORKS MTestLib
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON
)
set_target_properties(mapp2 PROPERTIES
XCODE_EMBED_FRAMEWORKS MTestLib
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON
)