From cf160bdab6595e9888f23bf9df0cf03613068240 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 5 Jan 2018 05:27:17 +0100 Subject: Get cflags from pkg config dependency --- include/Linker.hpp | 1 + include/PkgConfig.hpp | 8 ++++++++ include/Result.hpp | 8 ++++++++ 3 files changed, 17 insertions(+) (limited to 'include') 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; using GlobalIncludeDirCallbackFunc = std::function; + using CflagsCallbackFunc = std::function; } #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 validatePackageExists(const std::string &name); static Result validatePackageVersionAtLeast(const std::string &name, const std::string &version); static Result getDynamicLibsLinkerFlags(const std::vector &libs); + static Result getDynamicLibsCflags(const std::vector &libs); + static Result getDynamicLibsFlags(const std::vector &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 static Result Err(const Result &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; -- cgit v1.2.3