Set simplecpp std option

This commit is contained in:
Daniel Marjamäki 2021-04-26 16:32:44 +02:00
parent 659a03e754
commit 3a7979171c
1 changed files with 2 additions and 13 deletions

View File

@ -645,22 +645,11 @@ static simplecpp::DUI createDUI(const Settings &mSettings, const std::string &cf
dui.defines.push_back(s); dui.defines.push_back(s);
} }
if (Path::isCPP(filename)) {
if (mSettings.standards.cpp == Standards::CPP11)
dui.defines.emplace_back("__cplusplus=201103L");
else if (mSettings.standards.cpp == Standards::CPP14)
dui.defines.emplace_back("__cplusplus=201402L");
else if (mSettings.standards.cpp == Standards::CPP17)
dui.defines.emplace_back("__cplusplus=201703L");
else if (mSettings.standards.cpp == Standards::CPP20)
dui.defines.emplace_back("__cplusplus=202002L");
else
dui.defines.emplace_back("__cplusplus");
}
dui.undefined = mSettings.userUndefs; // -U dui.undefined = mSettings.userUndefs; // -U
dui.includePaths = mSettings.includePaths; // -I dui.includePaths = mSettings.includePaths; // -I
dui.includes = mSettings.userIncludes; // --include dui.includes = mSettings.userIncludes; // --include
if (Path::isCPP(filename))
dui.std = mSettings.standards.getCPP();
return dui; return dui;
} }