From 98ad7dd049a366e21d60a34548736a3c8ef72877 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 30 Dec 2017 04:32:49 +0100 Subject: Add support for windows (ugly fast solution) --- include/Conf.hpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'include/Conf.hpp') diff --git a/include/Conf.hpp b/include/Conf.hpp index 1f680e8..0ad1090 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" @@ -81,7 +82,7 @@ namespace sibs class Config { public: - static Result readFromFile(const char *filepath, const ConfigCallback &callback); + static Result readFromFile(const _tinydir_char_t *filepath, const ConfigCallback &callback); }; enum OptimizationLevel @@ -91,14 +92,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); @@ -111,7 +123,7 @@ namespace sibs return packageType; } - virtual const std::string& getTestPath() const + virtual const FileString& getTestPath() const { return testPath; } @@ -121,7 +133,7 @@ namespace sibs return dependencies; } - virtual const std::string& getProjectPath() const + virtual const FileString& getProjectPath() const { return projectPath; } @@ -141,9 +153,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 dependencies; std::vector includeDirs; @@ -154,7 +167,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"; } -- cgit v1.2.3