diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Conf.hpp | 17 | ||||
-rw-r--r-- | include/GlobalLib.hpp | 3 |
2 files changed, 18 insertions, 2 deletions
diff --git a/include/Conf.hpp b/include/Conf.hpp index b893d3a..1f680e8 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -84,10 +84,19 @@ namespace sibs static Result<bool> readFromFile(const char *filepath, const ConfigCallback &callback); }; + enum OptimizationLevel + { + OPT_LEV_NONE, + OPT_LEV_DEBUG, + OPT_LEV_RELEASE + }; + + const char* asString(OptimizationLevel optLevel); + class SibsConfig : public ConfigCallback { public: - SibsConfig(const std::string &_projectPath) : projectPath(_projectPath), finishedProcessing(false), packageType((PackageType)-1) {} + SibsConfig(const std::string &_projectPath, OptimizationLevel _optimizationLevel = OPT_LEV_DEBUG) : projectPath(_projectPath), packageType((PackageType)-1), optimizationLevel(_optimizationLevel), finishedProcessing(false) {} virtual ~SibsConfig(){} virtual const std::string& getPackageName() const @@ -121,6 +130,11 @@ namespace sibs { return includeDirs; } + + virtual OptimizationLevel getOptimizationLevel() const + { + return optimizationLevel; + } protected: virtual void processObject(StringView name) override; virtual void processField(StringView name, const ConfigValue &value) override; @@ -133,6 +147,7 @@ namespace sibs PackageType packageType; std::vector<Dependency> dependencies; std::vector<std::string> includeDirs; + OptimizationLevel optimizationLevel; bool finishedProcessing; }; diff --git a/include/GlobalLib.hpp b/include/GlobalLib.hpp index 78511c3..c67027e 100644 --- a/include/GlobalLib.hpp +++ b/include/GlobalLib.hpp @@ -4,6 +4,7 @@ #include "Result.hpp" #include "Linker.hpp" #include "Dependency.hpp" +#include "Conf.hpp" namespace sibs { @@ -17,7 +18,7 @@ namespace sibs }; static Result<bool> validatePackageExists(const std::string &globalLibRootDir, const std::string &name); - static Result<std::string> getLibsLinkerFlags(const std::string &globalLibRootDir, const std::string &name, const std::string &version, LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, LinkerFlagCallbackFunc dynamicLinkerFlagCallbackFunc); + static Result<std::string> getLibsLinkerFlags(const SibsConfig &parentConfig, const std::string &globalLibRootDir, const std::string &name, const std::string &version, LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, LinkerFlagCallbackFunc dynamicLinkerFlagCallbackFunc); static Result<bool> downloadDependency(const Dependency &dependency); }; } |