diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index 4e50964f96..c104d6e952 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -160,6 +160,7 @@ public: setValueIfVoid (shouldGenerateManifestValue(), true); setValueIfVoid (getArchitectureType(), get64BitArchName()); + setValueIfVoid (getDebugInformationFormatValue(), isDebug() ? "ProgramDatabase" : "None"); if (! isDebug()) updateOldLTOSetting(); @@ -203,6 +204,9 @@ public: String get64BitArchName() const { return "x64"; } String get32BitArchName() const { return "Win32"; } + Value getDebugInformationFormatValue() { return getValue (Ids::debugInformationFormat); } + String getDebugInformationFormatString() const { return config [Ids::debugInformationFormat]; } + String createMSVCConfigName() const { return getName() + "|" + (config [Ids::winArchitecture] == get64BitArchName() ? "x64" : "Win32"); @@ -227,6 +231,21 @@ public: StringArray (archTypes, numElementsInArray (archTypes)), Array (archTypes, numElementsInArray (archTypes)))); + + { + static const char* debugInfoOptions[] = { "None", "C7 Compatible (/Z7)", "Program Database (/Zi)", "Program Database for Edit And Continue (/ZI)", nullptr }; + static const char* debugInfoValues[] = { "None", "OldStyle", "ProgramDatabase", "EditAndContinue", nullptr }; + + props.add (new ChoicePropertyComponentWithEnablement (getDebugInformationFormatValue(), + isDebug() ? isDebugValue() : shouldGenerateDebugSymbolsValue(), + "Debug Information Format", + StringArray (debugInfoOptions), + Array (debugInfoValues)), + "The type of debugging information created for your program for this configuration." + " This will only be used in a debug configuration with no optimisation or a release configuration" + " with forced generation of debug symbols."); + } + props.add (new BooleanPropertyComponent (getFastMathValue(), "Relax IEEE compliance", "Enabled"), "Enable this to use FAST_MATH non-IEEE mode. (Warning: this can have unexpected results!)"); @@ -477,13 +496,11 @@ public: cl->createNewChildElement ("Optimization")->addTextElement (getOptimisationLevelString (config.getOptimisationLevelInt())); - if (isDebug && config.getOptimisationLevelInt() <= optimisationOff) + if ((isDebug || config.shouldGenerateDebugSymbols()) + && config.getOptimisationLevelInt() <= optimisationOff) { - isUsingEditAndContinue = ! config.is64Bit(); - cl->createNewChildElement ("DebugInformationFormat") - ->addTextElement (isUsingEditAndContinue ? "EditAndContinue" - : "ProgramDatabase"); + ->addTextElement (config.getDebugInformationFormatString()); } StringArray includePaths (getOwner().getHeaderSearchPaths (config)); diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h index 1222363f44..f2dc653563 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h +++ b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h @@ -124,6 +124,7 @@ namespace Ids DECLARE_ID (windowsCodeBlocksArchitecture); DECLARE_ID (toolset); DECLARE_ID (windowsTargetPlatformVersion); + DECLARE_ID (debugInformationFormat); DECLARE_ID (IPPLibrary); DECLARE_ID (msvcModuleDefinitionFile); DECLARE_ID (bigIcon); diff --git a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_DependencyPathPropertyComponent.h b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_DependencyPathPropertyComponent.h index 91273e4071..9f6943aba9 100644 --- a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_DependencyPathPropertyComponent.h +++ b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_DependencyPathPropertyComponent.h @@ -268,3 +268,30 @@ private: setEnabled (v.getValue()); } }; + +//============================================================================== +class ChoicePropertyComponentWithEnablement : public ChoicePropertyComponent, + private Value::Listener +{ +public: + ChoicePropertyComponentWithEnablement (const Value& valueToControl, + const Value& valueToListenTo, + const String& propertyName, + const StringArray& choices, + const Array& correspondingValues) + : ChoicePropertyComponent (valueToControl, propertyName, + choices, correspondingValues), + value (valueToListenTo) + { + value.addListener (this); + setEnabled (value.getValue()); + } + +private: + Value value; + + void valueChanged (Value& v) override + { + setEnabled (v.getValue()); + } +};