aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-07 12:04:20 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-07 12:04:24 +0100
commit0bb8fff4d481f5076639d28b55daf76dd2b2ea0f (patch)
tree07ef3c879ed94d50237e026de74910fa9e69d684 /include
parent82df40bd1fc82958ef90e7c917ce3eec382d4309 (diff)
Add c/c++ language version option, compile c/cc files with c compiler
Diffstat (limited to 'include')
-rw-r--r--include/Conf.hpp32
1 files changed, 31 insertions, 1 deletions
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;