aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-05 05:27:17 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-05 05:27:22 +0100
commitcf160bdab6595e9888f23bf9df0cf03613068240 (patch)
tree28c7e3c4d811dad4eb6547b37e8b3a438c366ea2 /include
parenta548abb5a6a83c9318e9db3cf71170a7610e2758 (diff)
Get cflags from pkg config dependency
Diffstat (limited to 'include')
-rw-r--r--include/Linker.hpp1
-rw-r--r--include/PkgConfig.hpp8
-rw-r--r--include/Result.hpp8
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;