diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h index f6793ac162..e57a4b218a 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h @@ -153,6 +153,9 @@ protected: Value getWholeProgramOptValue() { return getValue (Ids::wholeProgramOptimisation); } bool shouldDisableWholeProgramOpt() const { return static_cast (config [Ids::wholeProgramOptimisation]) > 0; } + Value getUsingRuntimeLibDLL() { return getValue (Ids::useRuntimeLibDLL); } + bool isUsingRuntimeLibDLL() const { return config [Ids::useRuntimeLibDLL]; } + String getOutputFilename (const String& suffix, bool forceSuffix) const { const String target (File::createLegalFileName (getTargetBinaryNameString().trim())); @@ -175,6 +178,7 @@ protected: "Always disable link-time code generation", nullptr }; const var wpoValues[] = { var(), var (1) }; + props.add (new BooleanPropertyComponent (getUsingRuntimeLibDLL(), "Runtime Library", "Use DLL version of runtime library")); props.add (new ChoicePropertyComponent (getWholeProgramOptValue(), "Whole Program Optimisation", StringArray (wpoNames), Array (wpoValues, numElementsInArray (wpoValues)))); @@ -739,8 +743,8 @@ protected: compiler->setAttribute ("AdditionalIncludeDirectories", replacePreprocessorTokens (config, getHeaderSearchPaths (config).joinIntoString (";"))); compiler->setAttribute ("PreprocessorDefinitions", getPreprocessorDefs (config, ";")); - compiler->setAttribute ("RuntimeLibrary", msvcNeedsDLLRuntimeLib ? (isDebug ? 3 : 2) // MT DLL - : (isDebug ? 1 : 0)); // MT static + compiler->setAttribute ("RuntimeLibrary", config.isUsingRuntimeLibDLL() ? (isDebug ? 3 : 2) // MT DLL + : (isDebug ? 1 : 0)); // MT static compiler->setAttribute ("RuntimeTypeInfo", "true"); compiler->setAttribute ("UsePrecompiledHeader", "0"); compiler->setAttribute ("PrecompiledHeaderFile", getIntDirFile (config.getOutputFilename (".pch", true))); @@ -1141,8 +1145,8 @@ protected: includePaths.add ("%(AdditionalIncludeDirectories)"); cl->createNewChildElement ("AdditionalIncludeDirectories")->addTextElement (includePaths.joinIntoString (";")); cl->createNewChildElement ("PreprocessorDefinitions")->addTextElement (getPreprocessorDefs (config, ";") + ";%(PreprocessorDefinitions)"); - cl->createNewChildElement ("RuntimeLibrary")->addTextElement (msvcNeedsDLLRuntimeLib ? (isDebug ? "MultiThreadedDebugDLL" : "MultiThreadedDLL") - : (isDebug ? "MultiThreadedDebug" : "MultiThreaded")); + cl->createNewChildElement ("RuntimeLibrary")->addTextElement (config.isUsingRuntimeLibDLL() ? (isDebug ? "MultiThreadedDebugDLL" : "MultiThreadedDLL") + : (isDebug ? "MultiThreadedDebug" : "MultiThreaded")); cl->createNewChildElement ("RuntimeTypeInfo")->addTextElement ("true"); cl->createNewChildElement ("PrecompiledHeader"); cl->createNewChildElement ("AssemblerListingLocation")->addTextElement ("$(IntDir)\\"); diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp b/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp index 8d3629d97c..f8054f4b46 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp @@ -141,7 +141,6 @@ ProjectExporter::ProjectExporter (Project& project_, const ValueTree& settings_) makefileIsDLL (false), msvcIsDLL (false), msvcIsWindowsSubsystem (true), - msvcNeedsDLLRuntimeLib (false), settings (settings_), project (project_), projectType (project_.getProjectType()), diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h index 69d3a3c6fa..d340bfeb0e 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h @@ -146,7 +146,7 @@ public: //============================================================================== String msvcTargetSuffix; StringPairArray msvcExtraPreprocessorDefs; - bool msvcIsDLL, msvcIsWindowsSubsystem, msvcNeedsDLLRuntimeLib; + bool msvcIsDLL, msvcIsWindowsSubsystem; String msvcDelayLoadedDLLs; //============================================================================== diff --git a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h index e7b2628d53..fb840e9da3 100644 --- a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h +++ b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h @@ -350,7 +350,6 @@ namespace RTASHelpers if (exporter.isVisualStudio()) { exporter.msvcTargetSuffix = ".dpm"; - exporter.msvcNeedsDLLRuntimeLib = true; String winbag (getRTASFolderRelativePath (exporter).getChildFile ("WinBag").toWindowsStyle()); @@ -375,6 +374,7 @@ namespace RTASHelpers for (ProjectExporter::ConfigIterator config (exporter); config.next();) { config->getValue (Ids::msvcModuleDefinitionFile) = msvcPathToRTASFolder + "juce_RTAS_WinExports.def"; + config->getValue (Ids::useRuntimeLibDLL) = true; if (config->getValue (Ids::postbuildCommand).toString().isEmpty()) config->getValue (Ids::postbuildCommand) = "copy /Y \"" + msvcPathToRTASFolder + "juce_RTAS_WinResources.rsr" @@ -532,7 +532,9 @@ namespace AAXHelpers if (exporter.isVisualStudio()) { exporter.msvcTargetSuffix = ".aaxplugin"; - exporter.msvcNeedsDLLRuntimeLib = true; + + for (ProjectExporter::ConfigIterator config (exporter); config.next();) + config->getValue (Ids::useRuntimeLibDLL) = true; } else { diff --git a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h index 133a0b3bca..80ad74a62a 100644 --- a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h +++ b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h @@ -81,6 +81,7 @@ namespace Ids DECLARE_ID (prebuildCommand); DECLARE_ID (postbuildCommand); DECLARE_ID (generateManifest); + DECLARE_ID (useRuntimeLibDLL); DECLARE_ID (wholeProgramOptimisation); DECLARE_ID (juceLinkage); DECLARE_ID (buildVST);