From 370cf229c6ff6b0108d01d910b1f7ccb86afb318 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 16 Nov 2017 16:51:50 +0000 Subject: [PATCH] Projucer: Fixed a bug in the VS exporter where link time optimisation settings were being ignored --- .../Source/ProjectSaving/jucer_ProjectExport_MSVC.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index aaab950884..5dcec910c7 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -167,7 +167,10 @@ public: setValueIfVoid (getPluginBinaryCopyStepEnabledValue(), false); if (! isDebug()) + { updateOldLTOSetting(); + setValueIfVoid (getLinkTimeOptimisationEnabledValue(), true); + } initialisePluginCachedValues(); } @@ -334,7 +337,8 @@ public: //============================================================================== void updateOldLTOSetting() { - getLinkTimeOptimisationEnabledValue() = (static_cast (config ["wholeProgramOptimisation"]) == 0); + if (config.getPropertyAsValue ("wholeProgramOptimisation", nullptr) != Value()) + getLinkTimeOptimisationEnabledValue() = (static_cast (config ["wholeProgramOptimisation"]) == 0); } void addVisualStudioPluginInstallPathProperties (PropertyListBuilder& props) @@ -441,15 +445,14 @@ public: e->setAttribute ("Label", "Configuration"); e->createNewChildElement ("ConfigurationType")->addTextElement (getProjectType()); e->createNewChildElement ("UseOfMfc")->addTextElement ("false"); + e->createNewChildElement ("WholeProgramOptimization")->addTextElement (config.isLinkTimeOptimisationEnabled() ? "true" + : "false"); const String charSet (config.getCharacterSet()); if (charSet.isNotEmpty()) e->createNewChildElement ("CharacterSet")->addTextElement (charSet); - if (config.isLinkTimeOptimisationEnabled()) - e->createNewChildElement ("WholeProgramOptimization")->addTextElement ("true"); - if (config.shouldLinkIncremental()) e->createNewChildElement ("LinkIncremental")->addTextElement ("true");