mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Add support for C++20 project language standard
This commit is contained in:
parent
aacca9b23c
commit
2707ea3ca0
7 changed files with 16 additions and 10 deletions
|
|
@ -287,7 +287,7 @@ void Project::initialiseProjectValues()
|
|||
useAppConfigValue.referTo (projectRoot, Ids::useAppConfig, getUndoManager(), true);
|
||||
addUsingNamespaceToJuceHeader.referTo (projectRoot, Ids::addUsingNamespaceToJuceHeader, getUndoManager(), true);
|
||||
|
||||
cppStandardValue.referTo (projectRoot, Ids::cppLanguageStandard, getUndoManager(), "14");
|
||||
cppStandardValue.referTo (projectRoot, Ids::cppLanguageStandard, getUndoManager(), "14");
|
||||
|
||||
headerSearchPathsValue.referTo (projectRoot, Ids::headerPath, getUndoManager());
|
||||
preprocessorDefsValue.referTo (projectRoot, Ids::defines, getUndoManager());
|
||||
|
|
|
|||
|
|
@ -209,8 +209,14 @@ public:
|
|||
bool shouldDisplaySplashScreen() const { return displaySplashScreenValue.get(); }
|
||||
String getSplashScreenColourString() const { return splashScreenColourValue.get(); }
|
||||
|
||||
static StringArray getCppStandardStrings() { return { "C++14", "C++17", "Use Latest" }; }
|
||||
static Array<var> getCppStandardVars() { return { "14", "17", "latest" }; }
|
||||
static StringArray getCppStandardStrings() { return { "C++14", "C++17", "C++20", "Use Latest" }; }
|
||||
static Array<var> getCppStandardVars() { return { "14", "17", "20", "latest" }; }
|
||||
|
||||
static String getLatestNumberedCppStandardString()
|
||||
{
|
||||
auto cppStandardVars = getCppStandardVars();
|
||||
return cppStandardVars[cppStandardVars.size() - 2];
|
||||
}
|
||||
|
||||
String getCppStandardString() const { return cppStandardValue.get(); }
|
||||
|
||||
|
|
|
|||
|
|
@ -1435,7 +1435,7 @@ private:
|
|||
auto projectStandard = project.getCppStandardString();
|
||||
|
||||
if (projectStandard == "latest")
|
||||
return String ("17");
|
||||
return project.getLatestNumberedCppStandardString();
|
||||
|
||||
return projectStandard;
|
||||
}();
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ private:
|
|||
auto cxxStandard = project.getCppStandardString();
|
||||
|
||||
if (cxxStandard == "latest")
|
||||
cxxStandard = "17";
|
||||
cxxStandard = project.getLatestNumberedCppStandardString();
|
||||
|
||||
out << " CXX_STANDARD " << cxxStandard << newLine;
|
||||
|
||||
|
|
@ -671,7 +671,7 @@ private:
|
|||
auto cxxStandard = project.getCppStandardString();
|
||||
|
||||
if (cxxStandard == "latest")
|
||||
cxxStandard = "17";
|
||||
cxxStandard = project.getLatestNumberedCppStandardString();
|
||||
|
||||
out << " CXX_STANDARD " << cxxStandard << newLine;
|
||||
|
||||
|
|
@ -1076,7 +1076,7 @@ private:
|
|||
auto cxxStandard = project.getCppStandardString();
|
||||
|
||||
if (cxxStandard == "latest")
|
||||
cxxStandard = "17";
|
||||
cxxStandard = project.getLatestNumberedCppStandardString();
|
||||
|
||||
out << " CXX_STANDARD " << cxxStandard << newLine;
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ private:
|
|||
auto cppStandard = config.project.getCppStandardString();
|
||||
|
||||
if (cppStandard == "latest")
|
||||
cppStandard = "17";
|
||||
cppStandard = project.getLatestNumberedCppStandardString();
|
||||
|
||||
flags.add ("-std=" + String (shouldUseGNUExtensions() ? "gnu++" : "c++") + cppStandard);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ private:
|
|||
auto cppStandard = project.getCppStandardString();
|
||||
|
||||
if (cppStandard == "latest")
|
||||
cppStandard = "17";
|
||||
cppStandard = project.getLatestNumberedCppStandardString();
|
||||
|
||||
result.add ("-std=" + String (shouldUseGNUExtensions() ? "gnu++" : "c++") + cppStandard);
|
||||
|
||||
|
|
|
|||
|
|
@ -1653,7 +1653,7 @@ public:
|
|||
auto cppStandard = owner.project.getCppStandardString();
|
||||
|
||||
if (cppStandard == "latest")
|
||||
cppStandard = "17";
|
||||
cppStandard = owner.project.getLatestNumberedCppStandardString();
|
||||
|
||||
s.set ("CLANG_CXX_LANGUAGE_STANDARD", (String (owner.shouldUseGNUExtensions() ? "gnu++"
|
||||
: "c++") + cppStandard).quoted());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue