From 61e71eb1dc971d03b5b82513adc8e3cf27d0edd4 Mon Sep 17 00:00:00 2001 From: "stefan.graenitz" Date: Tue, 31 May 2016 14:26:14 +0200 Subject: [PATCH] Add incremental linking option for Visual Studio exporters --- .../Project Saving/jucer_ProjectExport_MSVC.h | 15 +++++++++++++++ extras/Projucer/Source/Utility/jucer_PresetIDs.h | 1 + 2 files changed, 16 insertions(+) diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h index c174c82718..9f741b3e41 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h @@ -335,6 +335,9 @@ protected: Value shouldGenerateManifestValue() { return getValue (Ids::generateManifest); } bool shouldGenerateManifest() const { return config [Ids::generateManifest]; } + Value shouldLinkIncrementalValue() { return getValue (Ids::enableIncrementalLinking); } + bool shouldLinkIncremental() const { return config [Ids::enableIncrementalLinking]; } + Value getWholeProgramOptValue() { return getValue (Ids::wholeProgramOptimisation); } bool shouldDisableWholeProgramOpt() const { return static_cast (config [Ids::wholeProgramOptimisation]) > 0; } @@ -399,6 +402,12 @@ protected: StringArray (wpoNames), Array (wpoValues, numElementsInArray (wpoValues)))); } + { + props.add (new BooleanPropertyComponent (shouldLinkIncrementalValue(), "Incremental Linking", "Enable"), + "Enable to avoid linking from scratch for every new build. " + "Disable to ensure that your final release build does not contain padding or thunks."); + } + if (! isDebug()) props.add (new BooleanPropertyComponent (shouldGenerateDebugSymbolsValue(), "Debug Symbols", "Force generation of debug symbols")); @@ -1026,6 +1035,7 @@ protected: linker->setAttribute ("IgnoreDefaultLibraryNames", isDebug ? "libcmt.lib, msvcrt.lib" : ""); linker->setAttribute ("GenerateDebugInformation", (isDebug || config.shouldGenerateDebugSymbols()) ? "true" : "false"); + linker->setAttribute ("LinkIncremental", config.shouldLinkIncremental() ? "2" : "1"); linker->setAttribute ("ProgramDatabaseFile", getIntDirFile (config, config.getOutputFilename (".pdb", true))); linker->setAttribute ("SubSystem", msvcIsWindowsSubsystem ? "2" : "1"); @@ -1073,6 +1083,8 @@ protected: linker->setAttribute ("OutputFile", getOutDirFile (config, config.getOutputFilename (msvcTargetSuffix, false))); linker->setAttribute ("IgnoreDefaultLibraryNames", isDebug ? "libcmt.lib, msvcrt.lib" : ""); + + linker->setAttribute ("LinkIncremental", config.shouldLinkIncremental() ? "2" : "1"); } else { @@ -1370,6 +1382,9 @@ protected: if (! (config.isDebug() || config.shouldDisableWholeProgramOpt())) e->createNewChildElement ("WholeProgramOptimization")->addTextElement ("true"); + if (config.shouldLinkIncremental()) + e->createNewChildElement ("LinkIncremental")->addTextElement ("true"); + if (config.is64Bit()) e->createNewChildElement ("PlatformToolset")->addTextElement (getPlatformToolset()); } diff --git a/extras/Projucer/Source/Utility/jucer_PresetIDs.h b/extras/Projucer/Source/Utility/jucer_PresetIDs.h index 3bbb26e206..f9203f3323 100644 --- a/extras/Projucer/Source/Utility/jucer_PresetIDs.h +++ b/extras/Projucer/Source/Utility/jucer_PresetIDs.h @@ -117,6 +117,7 @@ namespace Ids DECLARE_ID (generateManifest); DECLARE_ID (useRuntimeLibDLL); DECLARE_ID (wholeProgramOptimisation); + DECLARE_ID (enableIncrementalLinking); DECLARE_ID (buildVST); DECLARE_ID (bundleIdentifier); DECLARE_ID (aaxIdentifier);