Browse Source

Introjucer: added option for setting warning levels in VC++

tags/2021-05-28
jules 13 years ago
parent
commit
18ea13a625
2 changed files with 19 additions and 2 deletions
  1. +18
    -2
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h
  2. +1
    -0
      extras/Introjucer/Source/Utility/jucer_PresetIDs.h

+ 18
- 2
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h View File

@@ -91,11 +91,22 @@ protected:
MSVCBuildConfiguration (Project& project, const ValueTree& settings)
: BuildConfiguration (project, settings)
{
if (getWarningLevel() == 0)
getWarningLevelValue() = 4;
}
Value getWarningLevelValue() const { return getValue (Ids::winWarningLevel); }
int getWarningLevel() const { return getWarningLevelValue().getValue(); }
void createPropertyEditors (PropertyListBuilder& props)
{
createBasicPropertyEditors (props);
const char* const warningLevelNames[] = { "Low", "Medium", "High", nullptr };
const int warningLevels[] = { 2, 3, 4, 0 };
props.add (new ChoicePropertyComponent (getWarningLevelValue(), "Warning Level",
StringArray (warningLevelNames), Array<var> (warningLevels)));
}
};
@@ -104,6 +115,11 @@ protected:
return new MSVCBuildConfiguration (project, settings);
}
static int getWarningLevel (const BuildConfiguration& config)
{
return dynamic_cast <const MSVCBuildConfiguration&> (config).getWarningLevel();
}
//==============================================================================
String getIntermediatesPath (const BuildConfiguration& config) const
{
@@ -601,7 +617,7 @@ protected:
compiler->setAttribute ("AssemblerListingLocation", FileHelpers::windowsStylePath (intermediatesPath + "/"));
compiler->setAttribute ("ObjectFile", FileHelpers::windowsStylePath (intermediatesPath + "/"));
compiler->setAttribute ("ProgramDataBaseFileName", FileHelpers::windowsStylePath (intermediatesPath + "/"));
compiler->setAttribute ("WarningLevel", "4");
compiler->setAttribute ("WarningLevel", String (getWarningLevel (config)));
compiler->setAttribute ("SuppressStartupBanner", "true");
const String extraFlags (replacePreprocessorTokens (config, getExtraCompilerFlags().toString()).trim());
@@ -1264,7 +1280,7 @@ protected:
cl->createNewChildElement ("AssemblerListingLocation")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/"));
cl->createNewChildElement ("ObjectFileName")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/"));
cl->createNewChildElement ("ProgramDataBaseFileName")->addTextElement (FileHelpers::windowsStylePath (intermediatesPath + "/"));
cl->createNewChildElement ("WarningLevel")->addTextElement ("Level4");
cl->createNewChildElement ("WarningLevel")->addTextElement ("Level" + String (getWarningLevel (*config)));
cl->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true");
cl->createNewChildElement ("MultiProcessorCompilation")->addTextElement ("true");


+ 1
- 0
extras/Introjucer/Source/Utility/jucer_PresetIDs.h View File

@@ -62,6 +62,7 @@ namespace Ids
DECLARE_ID (osxCompatibility);
DECLARE_ID (osxArchitecture);
DECLARE_ID (winArchitecture);
DECLARE_ID (winWarningLevel);
DECLARE_ID (jucerVersion);
DECLARE_ID (projectType);
DECLARE_ID (prebuildCommand);


Loading…
Cancel
Save