diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2022-02-10 18:16:18 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2022-02-13 14:39:14 (GMT) |
commit | 40178f3c908795a993148553a04be25748942efc (patch) | |
tree | f5fbc0d7f48fb80a450fbf438ef21b8376d69ac3 /Source/cmComputeLinkInformation.cxx | |
parent | 350c1fd60717fc4bd4a1ec32baefc510d8caa6bd (diff) | |
download | CMake-40178f3c908795a993148553a04be25748942efc.zip CMake-40178f3c908795a993148553a04be25748942efc.tar.gz CMake-40178f3c908795a993148553a04be25748942efc.tar.bz2 |
cmGlobalGenerator: Add helper to split framework path
cmComputeLinkInformation and cmGlobalXCodeGenerator now rely on
this method to handle framework paths.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 15e9d60..16f2003 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -8,6 +8,7 @@ #include <utility> #include <cm/memory> +#include <cm/optional> #include <cmext/algorithm> #include "cmComputeLinkDepends.h" @@ -1679,7 +1680,8 @@ void cmComputeLinkInformation::AddFrameworkItem(LinkEntry const& entry) std::string const& item = entry.Item.Value; // Try to separate the framework name and path. - if (!this->SplitFramework.find(item)) { + auto fwItems = this->GlobalGenerator->SplitFrameworkPath(item); + if (!fwItems) { std::ostringstream e; e << "Could not parse framework path \"" << item << "\" " << "linked by target " << this->Target->GetName() << "."; @@ -1687,8 +1689,8 @@ void cmComputeLinkInformation::AddFrameworkItem(LinkEntry const& entry) return; } - std::string fw_path = this->SplitFramework.match(1); - std::string fw = this->SplitFramework.match(2); + std::string fw_path = std::move(fwItems->first); + std::string fw = std::move(fwItems->second); std::string full_fw = cmStrCat(fw_path, '/', fw, ".framework/", fw); // Add the directory portion to the framework search path. @@ -1739,9 +1741,6 @@ void cmComputeLinkInformation::ComputeFrameworkInfo() this->FrameworkPathsEmitted.insert(implicitDirVec.begin(), implicitDirVec.end()); - - // Regular expression to extract a framework path and name. - this->SplitFramework.compile("(.*)/(.*)\\.framework$"); } void cmComputeLinkInformation::AddFrameworkPath(std::string const& p) |