@@ -167,6 +167,48 @@ struct Warning
167167 Warning (State state, uint32_t number) : state(state), type(MSVCWarning), number(number) {}
168168};
169169
170+ struct CppStandard
171+ {
172+ enum Type
173+ {
174+ CPP11,
175+ CPP14,
176+ CPP17,
177+ CPP20,
178+ CPP23,
179+ };
180+
181+ // / @brief Get StringView from CppStandard::Type
182+ static constexpr StringView toString (Type type)
183+ {
184+ switch (type)
185+ {
186+ case CPP11: return " c++11" ;
187+ case CPP14: return " c++14" ;
188+ case CPP17: return " c++17" ;
189+ case CPP20: return " c++20" ;
190+ case CPP23: return " c++23" ;
191+ }
192+ Assert::unreachable ();
193+ }
194+
195+ // / @brief Get MSVC LanguageStandard value from CppStandard::Type (e.g., stdcpp14)
196+ static constexpr StringView toMSVCString (Type type)
197+ {
198+ switch (type)
199+ {
200+ case CPP11: return " stdcpp11" ;
201+ case CPP14: return " stdcpp14" ;
202+ case CPP17: return " stdcpp17" ;
203+ case CPP20: return " stdcpp20" ;
204+ case CPP23: return " stdcpp23" ;
205+ }
206+ Assert::unreachable ();
207+ }
208+
209+ // / @brief Get Makefile -std= flag from CppStandard::Type
210+ static StringView toMakefileFlag (Type type) { return toString (type); }
211+ };
170212// / @brief Compile flags (include paths, preprocessor defines etc.)
171213struct CompileFlags
172214{
@@ -182,6 +224,8 @@ struct CompileFlags
182224 Parameter<bool > enableStdCpp = false ; // /< Enable and include C++ Standard Library
183225 Parameter<bool > enableCoverage = false ; // /< Enables code coverage instrumentation
184226
227+ Parameter<CppStandard::Type> cppStandard = CppStandard::CPP14; // /< C++ language standard version
228+
185229 // / @brief Merges opinions about flags into target flags
186230 // / @param opinions Opinions about flags from strongest to weakest
187231 // / @param flags Output flags
0 commit comments