diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index 8b395fa333..7fbb21181a 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -151,12 +151,18 @@ bool Project::setCppVersionFromOldExporterSettings() return false; } +void Project::updateDeprecatedProjectSettings() +{ + for (Project::ExporterIterator exporter (*this); exporter.next();) + exporter->updateDeprecatedSettings(); +} + void Project::updateDeprecatedProjectSettingsInteractively() { jassert (! ProjucerApplication::getApp().isRunningCommandLine); for (Project::ExporterIterator exporter (*this); exporter.next();) - exporter->updateDeprecatedProjectSettingsInteractively(); + exporter->updateDeprecatedSettingsInteractively(); } void Project::initialiseMainGroup() @@ -580,8 +586,6 @@ Result Project::loadDocument (const File& file) parsedPreprocessorDefs = parsePreprocessorDefs (preprocessorDefsValue.get()); - setCppVersionFromOldExporterSettings(); - removeDefunctExporters(); updateOldModulePaths(); updateOldStyleConfigList(); @@ -589,6 +593,9 @@ Result Project::loadDocument (const File& file) moveOldPropertyFromProjectToAllExporters (Ids::smallIcon); getEnabledModules().sortAlphabetically(); + setCppVersionFromOldExporterSettings(); + updateDeprecatedProjectSettings(); + setChangedFlag (false); if (! ProjucerApplication::getApp().isRunningCommandLine) diff --git a/extras/Projucer/Source/Project/jucer_Project.h b/extras/Projucer/Source/Project/jucer_Project.h index 4bb0e1a661..63b82b4144 100644 --- a/extras/Projucer/Source/Project/jucer_Project.h +++ b/extras/Projucer/Source/Project/jucer_Project.h @@ -434,6 +434,9 @@ private: std::unique_ptr enabledModuleList; std::unique_ptr exporterPathsModuleList; + //============================================================================== + void updateDeprecatedProjectSettings(); + //============================================================================== bool shouldWriteLegacyPluginFormatSettings = false; bool shouldWriteLegacyPluginCharacteristicsSettings = false; diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index 07a6b1fea3..005e98dc5f 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -31,8 +31,6 @@ public: manifestFileValue (settings, Ids::msvcManifestFile, getUndoManager()) { targetLocationValue.setDefault (getDefaultBuildsRootFolder() + folderName); - - updateOldSettings(); } virtual int getVisualStudioVersion() const = 0; @@ -88,6 +86,41 @@ public: } //============================================================================== + void updateDeprecatedSettings() override + { + { + auto oldStylePrebuildCommand = getSettingString (Ids::prebuildCommand); + settings.removeProperty (Ids::prebuildCommand, nullptr); + + if (oldStylePrebuildCommand.isNotEmpty()) + for (ConfigIterator config (*this); config.next();) + dynamic_cast (*config).getValue (Ids::prebuildCommand) = oldStylePrebuildCommand; + } + + { + auto oldStyleLibName = getSettingString ("libraryName_Debug"); + settings.removeProperty ("libraryName_Debug", nullptr); + + if (oldStyleLibName.isNotEmpty()) + for (ConfigIterator config (*this); config.next();) + if (config->isDebug()) + config->getValue (Ids::targetName) = oldStyleLibName; + } + + { + auto oldStyleLibName = getSettingString ("libraryName_Release"); + settings.removeProperty ("libraryName_Release", nullptr); + + if (oldStyleLibName.isNotEmpty()) + for (ConfigIterator config (*this); config.next();) + if (! config->isDebug()) + config->getValue (Ids::targetName) = oldStyleLibName; + } + + for (ConfigIterator i (*this); i.next();) + dynamic_cast (*i).updateOldLTOSetting(); + } + void initialiseDependencyPathValues() override { vstLegacyPathValueWrapper.init ({ settings, Ids::vstLegacyFolder, nullptr }, @@ -131,9 +164,6 @@ public: aaxBinaryLocation (config, Ids::aaxBinaryLocation, getUndoManager()), unityPluginBinaryLocation (config, Ids::unityPluginBinaryLocation, getUndoManager(), {}) { - if (! isDebug()) - updateOldLTOSetting(); - setPluginBinaryCopyLocationDefaults(); optimisationLevelValue.setDefault (isDebug() ? optimisationOff : optimiseFull); @@ -274,6 +304,12 @@ public: return result; } + void updateOldLTOSetting() + { + if (! isDebug() && config.getPropertyAsValue ("wholeProgramOptimisation", nullptr) != Value()) + linkTimeOptimisationValue = (static_cast (config ["wholeProgramOptimisation"]) == 0); + } + private: ValueWithDefault warningLevelValue, warningsAreErrorsValue, prebuildCommandValue, postbuildCommandValue, generateDebugSymbolsValue, generateManifestValue, enableIncrementalLinkingValue, useRuntimeLibDLLValue, multiProcessorCompilationValue, @@ -285,12 +321,6 @@ public: Value architectureValueToListenTo; //============================================================================== - void updateOldLTOSetting() - { - if (config.getPropertyAsValue ("wholeProgramOptimisation", nullptr) != Value()) - linkTimeOptimisationValue = (static_cast (config ["wholeProgramOptimisation"]) == 0); - } - void addVisualStudioPluginInstallPathProperties (PropertyListBuilder& props) { auto isBuildingAnyPlugins = (project.shouldBuildVST() || project.shouldBuildVST3() || project.shouldBuildRTAS() @@ -1469,38 +1499,6 @@ protected: String getIntDirFile (const BuildConfiguration& config, const String& file) const { return prependIfNotAbsolute (replacePreprocessorTokens (config, file), "$(IntDir)\\"); } String getOutDirFile (const BuildConfiguration& config, const String& file) const { return prependIfNotAbsolute (replacePreprocessorTokens (config, file), "$(OutDir)\\"); } - void updateOldSettings() - { - { - auto oldStylePrebuildCommand = getSettingString (Ids::prebuildCommand); - settings.removeProperty (Ids::prebuildCommand, nullptr); - - if (oldStylePrebuildCommand.isNotEmpty()) - for (ConfigIterator config (*this); config.next();) - dynamic_cast (*config).getValue (Ids::prebuildCommand) = oldStylePrebuildCommand; - } - - { - auto oldStyleLibName = getSettingString ("libraryName_Debug"); - settings.removeProperty ("libraryName_Debug", nullptr); - - if (oldStyleLibName.isNotEmpty()) - for (ConfigIterator config (*this); config.next();) - if (config->isDebug()) - config->getValue (Ids::targetName) = oldStyleLibName; - } - - { - auto oldStyleLibName = getSettingString ("libraryName_Release"); - settings.removeProperty ("libraryName_Release", nullptr); - - if (oldStyleLibName.isNotEmpty()) - for (ConfigIterator config (*this); config.next();) - if (! config->isDebug()) - config->getValue (Ids::targetName) = oldStyleLibName; - } - } - BuildConfiguration::Ptr createBuildConfig (const ValueTree& v) const override { return *new MSVCBuildConfiguration (project, v, *this); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index d474bee71a..2ea1fe2d7d 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -607,7 +607,7 @@ public: jassert (targets.size() > 0); } - void updateDeprecatedProjectSettingsInteractively() override + void updateDeprecatedSettingsInteractively() override { if (hasInvalidPostBuildScript()) { diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp index 710a96ccb9..1122a8f5be 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp @@ -259,8 +259,6 @@ ProjectExporter::~ProjectExporter() { } -void ProjectExporter::updateDeprecatedProjectSettingsInteractively() {} - String ProjectExporter::getName() const { if (! getAllDefaultBuildsFolders().contains (getTargetLocationString())) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h index d5348b6061..1064d8f68c 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h @@ -73,8 +73,9 @@ public: virtual bool shouldFileBeCompiledByDefault (const File& path) const; virtual bool canCopeWithDuplicateFiles() = 0; virtual bool supportsUserDefinedConfigurations() const = 0; // false if exporter only supports two configs Debug and Release - virtual void updateDeprecatedProjectSettingsInteractively(); - virtual void initialiseDependencyPathValues() {} + virtual void updateDeprecatedSettings() {} + virtual void updateDeprecatedSettingsInteractively() {} + virtual void initialiseDependencyPathValues() {} // IDE targeted by exporter virtual bool isXcode() const = 0;