mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
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
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user