Browse Source

Added support for setting the Windows target platform version in VS2017

tags/2021-05-28
hogliux 8 years ago
parent
commit
4c385e158c
2 changed files with 27 additions and 1 deletions
  1. +26
    -1
      extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h
  2. +1
    -0
      extras/Projucer/Source/Utility/jucer_PresetIDs.h

+ 26
- 1
extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h View File

@@ -1444,6 +1444,7 @@ public:
}
getOwner().addPlatformToolsetToPropertyGroup (projectXml);
getOwner().addWindowsTargetPlatformVersionToPropertyGroup (projectXml);
getOwner().addIPPSettingToPropertyGroup (projectXml);
}
@@ -1688,7 +1689,8 @@ protected:
}
};
virtual void addPlatformToolsetToPropertyGroup (XmlElement&) const {}
virtual void addPlatformToolsetToPropertyGroup (XmlElement&) const {}
virtual void addWindowsTargetPlatformVersionToPropertyGroup (XmlElement&) const {}
void addIPPSettingToPropertyGroup (XmlElement& p) const
{
@@ -1868,6 +1870,9 @@ 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);
@@ -1889,6 +1894,26 @@ public:
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" };
Array<var> targetPlatforms;
targetPlatforms.add (var());
for (int i = 1; i < numElementsInArray (targetPlatformNames); ++i)
targetPlatforms.add (var (targetPlatformNames[i]));
props.add (new ChoicePropertyComponent (getWindowsTargetPlatformVersionValue(), "VS2017 Windows Target Platform",
StringArray (targetPlatformNames), 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)


+ 1
- 0
extras/Projucer/Source/Utility/jucer_PresetIDs.h View File

@@ -112,6 +112,7 @@ namespace Ids
DECLARE_ID (linuxCodeBlocksArchitecture);
DECLARE_ID (windowsCodeBlocksArchitecture);
DECLARE_ID (toolset);
DECLARE_ID (windowsTargetPlatformVersion);
DECLARE_ID (IPPLibrary);
DECLARE_ID (msvcModuleDefinitionFile);
DECLARE_ID (bigIcon);


Loading…
Cancel
Save