diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-12-16 11:07:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-12-18 15:18:25 (GMT) |
commit | defbfd6f55b2f2fdbb37e6f88867dfaac9180531 (patch) | |
tree | 821355dd51e6f89208565a5495d5bd5ea00da89a /Source | |
parent | e42eaa43425887b28f985f8a524dbcba8aab4a7e (diff) | |
download | CMake-defbfd6f55b2f2fdbb37e6f88867dfaac9180531.zip CMake-defbfd6f55b2f2fdbb37e6f88867dfaac9180531.tar.gz CMake-defbfd6f55b2f2fdbb37e6f88867dfaac9180531.tar.bz2 |
Xcode: Restore support for standalone IMPORTED_LOCATION_<CONFIG>
In commit 878ae03832 (macOS: IMPORTED framework: Honor SYSTEM target
property in all cases, 2023-08-27, v3.28.0-rc1~162^2) we broke support
for `IMPORTED_LOCATION_<CONFIG>` without `IMPORTED_CONFIGURATIONS`.
Previously it worked if the importing project's configurations match the
set of `IMPORTED_LOCATION_<CONFIG>` properties set. Fix that case.
Fixes: #25506
Issue: #25515
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8af92e5..9bd9fef 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -8762,11 +8762,23 @@ bool cmGeneratorTarget::IsFrameworkOnApple() const bool cmGeneratorTarget::IsImportedFrameworkFolderOnApple( const std::string& config) const { - return this->IsApple() && this->IsImported() && - (this->GetType() == cmStateEnums::STATIC_LIBRARY || - this->GetType() == cmStateEnums::SHARED_LIBRARY || - this->GetType() == cmStateEnums::UNKNOWN_LIBRARY) && - cmSystemTools::IsPathToFramework(this->GetLocation(config)); + if (this->IsApple() && this->IsImported() && + (this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::UNKNOWN_LIBRARY)) { + std::string cfg = config; + if (cfg.empty() && this->GetGlobalGenerator()->IsXcode()) { + // FIXME(#25515): Remove the need for this workaround. + // The Xcode generator queries include directories without any + // specific configuration. Pick one in case this target does + // not set either IMPORTED_LOCATION or IMPORTED_CONFIGURATIONS. + cfg = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig)[0]; + } + return cmSystemTools::IsPathToFramework(this->GetLocation(cfg)); + } + + return false; } bool cmGeneratorTarget::IsAppBundleOnApple() const |