diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Linker.hpp | 1 | ||||
-rw-r--r-- | include/PkgConfig.hpp | 8 | ||||
-rw-r--r-- | include/Result.hpp | 8 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/Linker.hpp b/include/Linker.hpp index 90bebe2..acf31e4 100644 --- a/include/Linker.hpp +++ b/include/Linker.hpp @@ -7,6 +7,7 @@ namespace sibs { using LinkerFlagCallbackFunc = std::function<void(const std::string&)>; using GlobalIncludeDirCallbackFunc = std::function<void(const std::string&)>; + using CflagsCallbackFunc = std::function<void(const std::string&)>; } #endif //SIBS_LINKER_HPP diff --git a/include/PkgConfig.hpp b/include/PkgConfig.hpp index e525843..e41b216 100644 --- a/include/PkgConfig.hpp +++ b/include/PkgConfig.hpp @@ -10,6 +10,12 @@ namespace sibs { + struct PkgConfigFlags + { + std::string linkerFlags; + std::string cflags; + }; + class PkgConfig { public: @@ -17,6 +23,8 @@ namespace sibs static Result<bool> validatePackageExists(const std::string &name); static Result<bool> validatePackageVersionAtLeast(const std::string &name, const std::string &version); static Result<std::string> getDynamicLibsLinkerFlags(const std::vector<Dependency> &libs); + static Result<std::string> getDynamicLibsCflags(const std::vector<Dependency> &libs); + static Result<PkgConfigFlags> getDynamicLibsFlags(const std::vector<Dependency> &libs); }; } #endif // OS_FAMILY_POSIX diff --git a/include/Result.hpp b/include/Result.hpp index e8f4d12..22cee35 100644 --- a/include/Result.hpp +++ b/include/Result.hpp @@ -16,6 +16,13 @@ namespace sibs result.errorCode = 0; return result; } + + static Result Ok(const T &&value) + { + Result result(value); + result.errorCode = 0; + return result; + } template <typename OtherType> static Result Err(const Result<OtherType> &other) @@ -57,6 +64,7 @@ namespace sibs operator bool () { return isOk(); } private: Result(const T &_value = T()) : value(_value) {} + Result(const T &&_value) : value(_value) {} private: T value; std::string errMsg; |