diff options
author | Brad King <brad.king@kitware.com> | 2023-12-19 13:03:41 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-12-19 13:04:01 (GMT) |
commit | 49dc6a44e0602e6a70c0466d789476c8b12fe509 (patch) | |
tree | 539e424cae3b245ea5852e6775ee4ea70c61cecf /Source | |
parent | 2cad910ecb39cf19367b89a5489c634ae5ac3375 (diff) | |
parent | defbfd6f55b2f2fdbb37e6f88867dfaac9180531 (diff) | |
download | CMake-49dc6a44e0602e6a70c0466d789476c8b12fe509.zip CMake-49dc6a44e0602e6a70c0466d789476c8b12fe509.tar.gz CMake-49dc6a44e0602e6a70c0466d789476c8b12fe509.tar.bz2 |
Merge topic 'Xcode-Check-Imported-Framework'
defbfd6f55 Xcode: Restore support for standalone IMPORTED_LOCATION_<CONFIG>
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9082
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 feeae95..289bb24 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -8860,11 +8860,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 |