From 0bb8fff4d481f5076639d28b55daf76dd2b2ea0f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 7 Jan 2018 12:04:20 +0100 Subject: Add c/c++ language version option, compile c/cc files with c compiler --- include/Conf.hpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'include/Conf.hpp') diff --git a/include/Conf.hpp b/include/Conf.hpp index 950b25a..3dd409d 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -110,6 +110,20 @@ namespace sibs PLATFORM_WIN64 }; + enum class CVersion + { + C89, // aka ansi + C99, + C11 + }; + + enum class CPPVersion + { + CPP11, + CPP14, + CPP17 + }; + const StringView CONFIGS[] = { "config.win32", "config.win32.static.debug", @@ -180,7 +194,9 @@ namespace sibs optimizationLevel(_optimizationLevel), finishedProcessing(false), useCmake(false), - buildTests(_buildTests) + buildTests(_buildTests), + cVersion(CVersion::C11), + cppVersion(CPPVersion::CPP11) { cmakeDirGlobal = projectPath; cmakeDirStatic = cmakeDirGlobal; @@ -313,6 +329,16 @@ namespace sibs return result; } + CVersion getCversion() const + { + return cVersion; + } + + CPPVersion getCppVersion() const + { + return cppVersion; + } + bool shouldUseCmake() const { return useCmake; @@ -342,6 +368,8 @@ namespace sibs void failInvalidFieldUnderObject(const StringView &fieldName) const; void validatePackageTypeDefined() const; private: + void parseCLang(const StringView &fieldName, const ConfigValue &fieldValue); + void parseCppLang(const StringView &fieldName, const ConfigValue &fieldValue); void parsePlatformConfigs(const StringView &fieldName, const ConfigValue &fieldValue); void parsePlatformConfig(const StringView &fieldName, const ConfigValue &fieldValue); void parsePlatformConfigStaticDebug(const StringView &fieldName, const ConfigValue &fieldValue); @@ -370,6 +398,8 @@ namespace sibs std::string cmakeArgsGlobal; std::string cmakeArgsStatic; std::string cmakeArgsDynamic; + CVersion cVersion; + CPPVersion cppVersion; bool useCmake; bool buildTests; bool finishedProcessing; -- cgit v1.2.3