aboutsummaryrefslogtreecommitdiff
path: root/include/GlobalLib.hpp
blob: b6ac60c7ccd7d66234fed6eb46f6bbb830b545b9 (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
29
30
31
32
33
#ifndef SIBS_GLOBALLIB_HPP
#define SIBS_GLOBALLIB_HPP

#include "Result.hpp"
#include "Linker.hpp"
#include "Conf.hpp"

namespace sibs
{
    class PackageListDependency;
    class GitDependency;
    
    class GlobalLib
    {
    public:
        enum DependencyError
        {
            DEPENDENCY_NOT_FOUND = 10,
            DEPENDENCY_VERSION_NO_MATCH = 20
        };

        static Result<bool> getLibs(const std::vector<PackageListDependency*> &libs, const SibsConfig &parentConfig, const FileString &globalLibRootDir, LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, LinkerFlagCallbackFunc dynamicLinkerFlagCallbackFunc, GlobalIncludeDirCallbackFunc globalIncludeDirCallback);
        static Result<bool> validatePackageExists(const FileString &globalLibRootDir, const std::string &name);
        static Result<bool> getLibsLinkerFlags(const SibsConfig &parentConfig, const FileString &globalLibRootDir, const std::string &name, const PackageVersionRange &versionRange, LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, LinkerFlagCallbackFunc dynamicLinkerFlagCallbackFunc, GlobalIncludeDirCallbackFunc globalIncludeDirCallback);
        static Result<bool> getLibsLinkerFlags(const SibsConfig &parentConfig, const FileString &globalLibRootDir, GitDependency *gitDependency, LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, LinkerFlagCallbackFunc dynamicLinkerFlagCallbackFunc, GlobalIncludeDirCallbackFunc globalIncludeDirCallback);
        static Result<bool> downloadDependency(PackageListDependency *dependency, Platform platform);
        static Result<bool> downloadDependency(GitDependency *dependency, Platform platform);
    private:
        static Result<bool> getLibsLinkerFlagsCommon(const SibsConfig &parentConfig, const FileString &packageDir, const std::string &dependencyName, LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, LinkerFlagCallbackFunc dynamicLinkerFlagCallbackFunc, GlobalIncludeDirCallbackFunc globalIncludeDirCallback);
    };
}

#endif //SIBS_GLOBALLIB_HPP