macOS: IMPORTED framework: Honor SYSTEM target property in all cases

When IMPORTED_LOCATION holds a framework folder, SYSTEM property must be respected.
This commit is contained in:
Marc Chevrier
2023-08-27 10:55:38 +02:00
parent ef2a6c35c2
commit 878ae03832
2 changed files with 15 additions and 3 deletions

View File

@@ -797,10 +797,10 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
*dirs, lg, config, headTarget, dagChecker, depTgt, language));
}
if (depTgt->Target->IsFrameworkOnApple()) {
if (depTgt->Target->IsFrameworkOnApple() ||
depTgt->IsImportedFrameworkFolderOnApple(config)) {
if (auto fwDescriptor = depTgt->GetGlobalGenerator()->SplitFrameworkPath(
depTgt->GetLocation(config),
cmGlobalGenerator::FrameworkFormat::Strict)) {
depTgt->GetLocation(config))) {
result.push_back(fwDescriptor->Directory);
result.push_back(fwDescriptor->GetFrameworkPath());
}

View File

@@ -22,3 +22,15 @@ set_target_properties(Example::Example2 PROPERTIES
add_library(testcase2 FrameworkSystemIncludeTest.c)
target_compile_options(testcase2 PRIVATE "-Werror=#pragma-messages")
target_link_libraries(testcase2 PRIVATE Example::Example2)
add_library(Example::Example3 SHARED IMPORTED)
set_target_properties(Example::Example3 PROPERTIES
FRAMEWORK 1
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/subdir/Example.framework"
)
add_library(testcase3 FrameworkSystemIncludeTest.c)
target_compile_options(testcase3 PRIVATE "-Werror=#pragma-messages")
target_link_libraries(testcase3 PRIVATE Example::Example3)