Skip to content

Commit

Permalink
Projucer: Don't set the windows target platform version in the .jucer…
Browse files Browse the repository at this point in the history
… file if it isn't specified
  • Loading branch information
ed95 committed Oct 27, 2017
1 parent e1c1814 commit 0e04fbf
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h
Expand Up @@ -84,12 +84,9 @@ class MSVCProjectExporterBase : public ProjectExporter

void addWindowsTargetPlatformProperties (PropertyListBuilder& props)
{
if (getWindowsTargetPlatformVersionValue() == Value())
getWindowsTargetPlatformVersionValue() = getDefaultWindowsTargetPlatformVersion();

auto isWindows10SDK = getVisualStudioVersion() > 14;

props.add (new TextPropertyComponent (getWindowsTargetPlatformVersionValue(), "Windows Target Platform", 20, false),
props.add (new TextWithDefaultPropertyComponent<String> (windowsTargetPlatformVersion, "Windows Target Platform", 20),
String ("Specifies the version of the Windows SDK that will be used when building this project. ")
+ (isWindows10SDK ? "You can see which SDKs you have installed on your machine by going to \"Program Files (x86)\\Windows Kits\\10\\Lib\". " : "")
+ "The default value for this exporter is " + getDefaultWindowsTargetPlatformVersion());
Expand All @@ -103,11 +100,8 @@ class MSVCProjectExporterBase : public ProjectExporter

void addWindowsTargetPlatformVersionToPropertyGroup (XmlElement& p) const
{
const String& targetVersion = getWindowsTargetPlatformVersion();

if (targetVersion.isNotEmpty())
forEachXmlChildElementWithTagName (p, e, "PropertyGroup")
e->createNewChildElement ("WindowsTargetPlatformVersion")->addTextElement (getWindowsTargetPlatformVersion());
forEachXmlChildElementWithTagName (p, e, "PropertyGroup")
e->createNewChildElement ("WindowsTargetPlatformVersion")->addTextElement (getWindowsTargetPlatformVersion());
}

void addIPPSettingToPropertyGroup (XmlElement& p) const
Expand Down Expand Up @@ -151,6 +145,12 @@ class MSVCProjectExporterBase : public ProjectExporter
TargetOS::windows)));
}

void initialiseWindowsTargetPlatformVersion()
{
windowsTargetPlatformVersion.referTo (settings, Ids::windowsTargetPlatformVersion,
nullptr, getDefaultWindowsTargetPlatformVersion());
}

//==============================================================================
class MSVCBuildConfiguration : public BuildConfiguration
{
Expand Down Expand Up @@ -1443,6 +1443,7 @@ class MSVCProjectExporterBase : public ProjectExporter
//==============================================================================
mutable File rcFile, iconFile;
OwnedArray<MSVCTargetBase> targets;
CachedValue<String> windowsTargetPlatformVersion;

File getProjectFile (const String& extension, const String& target) const
{
Expand Down Expand Up @@ -1839,6 +1840,7 @@ class MSVCProjectExporterVC2013 : public MSVCProjectExporterBase
: MSVCProjectExporterBase (p, t, "VisualStudio2013")
{
name = getName();
initialiseWindowsTargetPlatformVersion();
}

static const char* getName() { return "Visual Studio 2013"; }
Expand Down Expand Up @@ -1882,6 +1884,7 @@ class MSVCProjectExporterVC2015 : public MSVCProjectExporterBase
: MSVCProjectExporterBase (p, t, "VisualStudio2015")
{
name = getName();
initialiseWindowsTargetPlatformVersion();
}

static const char* getName() { return "Visual Studio 2015"; }
Expand Down Expand Up @@ -1924,6 +1927,7 @@ class MSVCProjectExporterVC2017 : public MSVCProjectExporterBase
: MSVCProjectExporterBase (p, t, "VisualStudio2017")
{
name = getName();
initialiseWindowsTargetPlatformVersion();
}

static const char* getName() { return "Visual Studio 2017"; }
Expand Down

0 comments on commit 0e04fbf

Please sign in to comment.