aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja/Ninja.hpp
blob: fdaa8900f58bdd3e5f610629b7367ec437b33c5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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);
        sibs::Result<bool> createBuildFile(const std::string &packageName, const std::vector<sibs::Dependency> &dependencies, const char *savePath);
        sibs::Result<bool> build(const char *buildFilePath);
    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;
    };
}

#endif //BACKEND_NINJA_HPP