diff options
author | Florian Schweiger <husker@dzdm.de> | 2022-02-02 17:23:35 (GMT) |
---|---|---|
committer | Florian Schweiger <husker@dzdm.de> | 2022-02-07 12:08:37 (GMT) |
commit | 5cdd774d519d7a524c398855573781dfdbf41a02 (patch) | |
tree | cc727ea79d59d35c4743722e6353311af3d8720a /Source/cmVisualStudioSlnData.h | |
parent | 309191052cf83bc5535ff66e9ece04cda18d5fe5 (diff) | |
download | CMake-5cdd774d519d7a524c398855573781dfdbf41a02.zip CMake-5cdd774d519d7a524c398855573781dfdbf41a02.tar.gz CMake-5cdd774d519d7a524c398855573781dfdbf41a02.tar.bz2 |
VS: Handle build target correct for .NET SDK style projects with Any CPU
* Extend Visual Studio solution parser for reading build target
* Map solution build target to project build target (especially for Any CPU)
* Use C++ <optional> template instead of pointer return value for cmSlnData::GetProjectByGUID
Diffstat (limited to 'Source/cmVisualStudioSlnData.h')
-rw-r--r-- | Source/cmVisualStudioSlnData.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Source/cmVisualStudioSlnData.h b/Source/cmVisualStudioSlnData.h index 19e58f5..100dd9b 100644 --- a/Source/cmVisualStudioSlnData.h +++ b/Source/cmVisualStudioSlnData.h @@ -8,6 +8,8 @@ #include <string> #include <vector> +#include <cm/optional> + class cmSlnProjectEntry { public: @@ -24,8 +26,15 @@ public: std::string GetName() const { return Name; } std::string GetRelativePath() const { return RelativePath; } + void AddProjectConfiguration(const std::string& solutionConfiguration, + const std::string& projectConfiguration); + + std::string GetProjectConfiguration( + const std::string& solutionConfiguration); + private: std::string Guid, Name, RelativePath; + std::map<std::string, std::string> projectConfigurationMap; }; class cmSlnData @@ -47,10 +56,10 @@ public: minimumVisualStudioVersion = version; } - const cmSlnProjectEntry* GetProjectByGUID( + const cm::optional<cmSlnProjectEntry> GetProjectByGUID( const std::string& projectGUID) const; - const cmSlnProjectEntry* GetProjectByName( + const cm::optional<cmSlnProjectEntry> GetProjectByName( const std::string& projectName) const; std::vector<cmSlnProjectEntry> GetProjects() const; @@ -59,10 +68,20 @@ public: const std::string& projectName, const std::string& projectRelativePath); + void AddConfiguration(const std::string& configuration) + { + solutionConfigurations.push_back(configuration); + } + + std::string GetConfigurationTarget(const std::string& projectName, + const std::string& solutionConfiguration, + const std::string& platformName); + private: std::string visualStudioVersion, minimumVisualStudioVersion; using ProjectStorage = std::map<std::string, cmSlnProjectEntry>; ProjectStorage ProjectsByGUID; using ProjectStringIndex = std::map<std::string, ProjectStorage::iterator>; ProjectStringIndex ProjectNameIndex; + std::vector<std::string> solutionConfigurations; }; |