diff options
author | dec05eba <dec05eba@protonmail.com> | 2017-12-09 16:36:23 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2017-12-09 16:38:31 +0100 |
commit | e7384a7672e4449bc194ca3ec66cdd4fcc63801e (patch) | |
tree | c79bc4dfbb8b3a752ae33f26f5e1b2992a484ace /backend/ninja/Ninja.hpp | |
parent | 6cc190828160586abc6961354a7c05e99537d7e2 (diff) |
Add support for dependencies (including version check)
This currently only works using pkg-config and it only adds
linking flags. Need to check with a library that also includes
other types of flags.
TODO: Fallback to dependencies sub directory and github/server
if package not found in pkg-config.
Diffstat (limited to 'backend/ninja/Ninja.hpp')
-rw-r--r-- | backend/ninja/Ninja.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/ninja/Ninja.hpp b/backend/ninja/Ninja.hpp index ad71c80..1ba20c7 100644 --- a/backend/ninja/Ninja.hpp +++ b/backend/ninja/Ninja.hpp @@ -1,18 +1,24 @@ #ifndef BACKEND_NINJA_HPP #define BACKEND_NINJA_HPP +#include "../../include/Dependency.hpp" +#include "../../include/Result.hpp" #include <vector> #include <string> + namespace backend { class Ninja { public: void addSourceFile(const char *filepath); - void build(const std::string &packageName, const char *savePath); + sibs::Result<bool> createBuildFile(const std::string &packageName, const std::vector<sibs::Dependency> &dependencies, const char *savePath); private: bool containsSourceFile(const char *filepath) const; + sibs::Result<std::string> getLinkerFlags(const std::vector<sibs::Dependency> &dependencies) const; + sibs::Result<bool> validatePkgConfigPackageExists(const std::string &name) const; + sibs::Result<bool> validatePkgConfigPackageVersionAtLeast(const std::string &name, const std::string &version) const; private: std::vector<std::string> sourceFiles; }; |