diff options
author | dec05eba <dec05eba@protonmail.com> | 2017-12-30 05:33:25 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2017-12-30 05:33:25 +0100 |
commit | 7c215c39d530f01235043a131d64d4c7f766e9ab (patch) | |
tree | d72effe043a46566e34276525081637cad1bb7a0 /include/Conf.hpp | |
parent | abab2184ade33097f3441f8cdd95dd27c5653930 (diff) | |
parent | 98ad7dd049a366e21d60a34548736a3c8ef72877 (diff) |
Merge release_0.1.0 to master
Add support for windows
Diffstat (limited to 'include/Conf.hpp')
-rw-r--r-- | include/Conf.hpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/include/Conf.hpp b/include/Conf.hpp index 5e3ed87..d147fca 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -1,6 +1,7 @@ #ifndef SIBS_CONF_HPP #define SIBS_CONF_HPP +#include "FileUtil.hpp" #include "Result.hpp" #include "StringView.hpp" #include "utils.hpp" @@ -82,7 +83,7 @@ namespace sibs class Config { public: - static Result<bool> readFromFile(const char *filepath, const ConfigCallback &callback); + static Result<bool> readFromFile(const _tinydir_char_t *filepath, const ConfigCallback &callback); }; enum OptimizationLevel @@ -92,14 +93,25 @@ namespace sibs OPT_LEV_RELEASE }; + enum class Compiler + { + GCC, + MSVC + }; + const char* asString(OptimizationLevel optLevel); class SibsConfig : public ConfigCallback { public: - SibsConfig(const std::string &_projectPath, OptimizationLevel _optimizationLevel = OPT_LEV_DEBUG) : projectPath(_projectPath), packageType((PackageType)-1), optimizationLevel(_optimizationLevel), finishedProcessing(false) {} + SibsConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel = OPT_LEV_DEBUG) : compiler(_compiler), projectPath(_projectPath), packageType((PackageType)-1), optimizationLevel(_optimizationLevel), finishedProcessing(false) {} virtual ~SibsConfig(){} + Compiler getCompiler() const + { + return compiler; + } + virtual const std::string& getPackageName() const { assert(finishedProcessing); @@ -112,7 +124,7 @@ namespace sibs return packageType; } - virtual const std::string& getTestPath() const + virtual const FileString& getTestPath() const { return testPath; } @@ -122,7 +134,7 @@ namespace sibs return dependencies; } - virtual const std::string& getProjectPath() const + virtual const FileString& getProjectPath() const { return projectPath; } @@ -151,9 +163,10 @@ namespace sibs virtual void finished() override; protected: StringView currentObject; - std::string projectPath; + Compiler compiler; + FileString projectPath; std::string packageName; - std::string testPath; + FileString testPath; PackageType packageType; std::vector<Dependency> dependencies; std::vector<std::string> includeDirs; @@ -165,7 +178,7 @@ namespace sibs class SibsTestConfig : public SibsConfig { public: - SibsTestConfig(const std::string &_projectPath) : SibsConfig(_projectPath) + SibsTestConfig(Compiler _compiler, const FileString &_projectPath) : SibsConfig(_compiler, _projectPath) { packageName = "test"; } |