From 2ae72ef74b1a8b3034c4685de68f39d1e198a84c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 26 May 2021 14:22:32 -0400 Subject: Xcode: Enable multi-arch TARGET_OBJECTS genex in [INTERFACE_]LINK_LIBRARIES This was an oversight in the original implementation. --- Source/cmGeneratorTarget.cxx | 2 ++ Tests/RunCMake/add_executable/RunCMakeTest.cmake | 4 +--- Tests/RunCMake/add_library/RunCMakeTest.cmake | 14 ++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e2ec82a..a7d825d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -6291,6 +6291,7 @@ void cmGeneratorTarget::ExpandLinkItems( } std::vector libs; std::unique_ptr cge = ge.Parse(value); + cge->SetEvaluateForBuildsystem(true); cmExpandList(cge->Evaluate(this->LocalGenerator, config, headTarget, &dagChecker, this, headTarget->LinkerLanguage), libs); @@ -7428,6 +7429,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( nullptr); cmGeneratorExpression ge(*btIt); std::unique_ptr const cge = ge.Parse(*le); + cge->SetEvaluateForBuildsystem(true); std::string const& evaluated = cge->Evaluate(this->LocalGenerator, config, head, &dagChecker, nullptr, this->LinkerLanguage); diff --git a/Tests/RunCMake/add_executable/RunCMakeTest.cmake b/Tests/RunCMake/add_executable/RunCMakeTest.cmake index 88916b7..70a68f2 100644 --- a/Tests/RunCMake/add_executable/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_executable/RunCMakeTest.cmake @@ -2,6 +2,4 @@ include(RunCMake) run_cmake(NoSources) run_cmake(OnlyObjectSources) -if(NOT RunCMake_GENERATOR STREQUAL "Xcode" OR NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]") - run_cmake(NoSourcesButLinkObjects) -endif() +run_cmake(NoSourcesButLinkObjects) diff --git a/Tests/RunCMake/add_library/RunCMakeTest.cmake b/Tests/RunCMake/add_library/RunCMakeTest.cmake index dfadb8f..3283625 100644 --- a/Tests/RunCMake/add_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_library/RunCMakeTest.cmake @@ -16,11 +16,9 @@ run_cmake(SHAREDwithOnlyObjectSources) run_cmake(MODULEwithOnlyObjectSources) run_cmake(UNKNOWNwithOnlyObjectSources) -if(NOT RunCMake_GENERATOR STREQUAL "Xcode" OR NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]") - run_cmake(INTERFACEwithNoSourcesButLinkObjects) - run_cmake(OBJECTwithNoSourcesButLinkObjects) - run_cmake(STATICwithNoSourcesButLinkObjects) - run_cmake(SHAREDwithNoSourcesButLinkObjects) - run_cmake(MODULEwithNoSourcesButLinkObjects) - run_cmake(UNKNOWNwithNoSourcesButLinkObjects) -endif() +run_cmake(INTERFACEwithNoSourcesButLinkObjects) +run_cmake(OBJECTwithNoSourcesButLinkObjects) +run_cmake(STATICwithNoSourcesButLinkObjects) +run_cmake(SHAREDwithNoSourcesButLinkObjects) +run_cmake(MODULEwithNoSourcesButLinkObjects) +run_cmake(UNKNOWNwithNoSourcesButLinkObjects) -- cgit v0.12