1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-26 02:14:22 +00:00

Made the Projucer's Windows target platform property chooser available to all Visual Studio exporters

This commit is contained in:
hogliux 2017-05-04 13:08:34 +01:00
parent ed51317ee6
commit ceab51f7c4

View file

@ -1734,6 +1734,8 @@ public:
int getVisualStudioVersion() const override { return 11; }
String getSolutionComment() const override { return "# Visual Studio 2012"; }
String getDefaultToolset() const override { return "v110"; }
Value getWindowsTargetPlatformVersionValue() { return getSetting (Ids::windowsTargetPlatformVersion); }
String getWindowsTargetPlatformVersion() const { return settings [Ids::windowsTargetPlatformVersion]; }
static MSVCProjectExporterVC2012* createForSettings (Project& project, const ValueTree& settings)
{
@ -1754,6 +1756,16 @@ public:
addIPPLibraryProperty (props);
}
void addWindowsTargetPlatformProperties (PropertyListBuilder& props)
{
static const char* targetPlatformNames[] = { "(default)", "8.1", "10.0.10240.0", "10.0.10586.0", "10.0.14393.0", "10.0.15063.0", nullptr };
const var targetPlatforms[] = { var(), "8.1", "10.0.10240.0", "10.0.10586.0", "10.0.14393.0", "10.0.15063.0" };
props.add (new ChoicePropertyComponent (getWindowsTargetPlatformVersionValue(), "Windows Target Platform",
StringArray (targetPlatformNames), Array<var> (targetPlatforms, numElementsInArray (targetPlatforms))),
"The Windows target platform version to use");
}
private:
void addPlatformToolsetToPropertyGroup (XmlElement& p) const override
{
@ -1761,6 +1773,15 @@ private:
e->createNewChildElement ("PlatformToolset")->addTextElement (getPlatformToolset());
}
void addWindowsTargetPlatformVersionToPropertyGroup (XmlElement& p) const override
{
const String& targetVersion = getWindowsTargetPlatformVersion();
if (targetVersion.isNotEmpty())
forEachXmlChildElementWithTagName (p, e, "PropertyGroup")
e->createNewChildElement ("WindowsTargetPlatformVersion")->addTextElement (getWindowsTargetPlatformVersion());
}
JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2012)
};
@ -1798,6 +1819,7 @@ public:
addToolsetProperty (props, toolsetNames, toolsets, numElementsInArray (toolsets));
addIPPLibraryProperty (props);
addWindowsTargetPlatformProperties (props);
}
JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2013)
@ -1837,6 +1859,7 @@ public:
addToolsetProperty (props, toolsetNames, toolsets, numElementsInArray (toolsets));
addIPPLibraryProperty (props);
addWindowsTargetPlatformProperties (props);
}
JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2015)
@ -1870,9 +1893,6 @@ public:
Value getCppStandardValue() { return getSetting (Ids::cppLanguageStandard); }
String getCppLanguageStandard() const override { return settings [Ids::cppLanguageStandard]; }
Value getWindowsTargetPlatformVersionValue() { return getSetting (Ids::windowsTargetPlatformVersion); }
String getWindowsTargetPlatformVersion() const { return settings [Ids::windowsTargetPlatformVersion]; }
void createExporterProperties (PropertyListBuilder& props) override
{
MSVCProjectExporterBase::createExporterProperties (props);
@ -1882,6 +1902,7 @@ public:
addToolsetProperty (props, toolsetNames, toolsets, numElementsInArray (toolsets));
addIPPLibraryProperty (props);
addWindowsTargetPlatformProperties (props);
static const char* cppStandardNames[] = { "(default)", "C++14", "Latest C++ Standard", nullptr };
@ -1893,22 +1914,6 @@ public:
props.add (new ChoicePropertyComponent (getCppStandardValue(), "C++ standard to use",
StringArray (cppStandardNames), cppStandardValues),
"The C++ language standard to use");
static const char* targetPlatformNames[] = { "(default)", "8.1", "10.0.10240.0", "10.0.10586.0", "10.0.14393.0", "10.0.15063.0", nullptr };
const var targetPlatforms[] = { var(), "8.1", "10.0.10240.0", "10.0.10586.0", "10.0.14393.0", "10.0.15063.0" };
props.add (new ChoicePropertyComponent (getWindowsTargetPlatformVersionValue(), "VS2017 Windows Target Platform",
StringArray (targetPlatformNames), Array<var> (targetPlatforms, numElementsInArray (targetPlatforms))),
"The Windows target platform to use");
}
void addWindowsTargetPlatformVersionToPropertyGroup (XmlElement& p) const override
{
const String& targetVersion = getWindowsTargetPlatformVersion();
if (targetVersion.isNotEmpty())
forEachXmlChildElementWithTagName (p, e, "PropertyGroup")
e->createNewChildElement ("WindowsTargetPlatformVersion")->addTextElement (getWindowsTargetPlatformVersion());
}
JUCE_DECLARE_NON_COPYABLE (MSVCProjectExporterVC2017)