aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2017-12-28 16:57:06 +0100
committerdec05eba <dec05eba@protonmail.com>2017-12-28 16:57:11 +0100
commit1f583ebb6e3973c992d59886659bf53ff87f41de (patch)
treecfefa98bf921d443f577785d744a5fe6d12f2e86 /include
parentda405ce0c1c9c675aee1710917d9d89b7eb34922 (diff)
Add optimization level option to building
Diffstat (limited to 'include')
-rw-r--r--include/Conf.hpp17
-rw-r--r--include/GlobalLib.hpp3
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);
};
}