From c244361b8ae743bcb326b9a1a168f2fdcab491e8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 13 Dec 2017 19:58:58 +0100 Subject: Change linking order for pkg-config Linking should be added in the order of dependencies. Modified linking logic to check global lib dir if pkg-config fails (missing package, pkg-config is not installed or any other reason), also required for Windows. --- src/GlobalLib.cpp | 6 +++++- src/PkgConfig.cpp | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/GlobalLib.cpp b/src/GlobalLib.cpp index 203cd0f..617f993 100644 --- a/src/GlobalLib.cpp +++ b/src/GlobalLib.cpp @@ -145,7 +145,11 @@ namespace sibs staticLibPath += "/lib"; staticLibPath += name; staticLibPath += ".a"; - linkerFlagCallbackFunc(staticLibPath); + + string staticLibPathCmd = "'"; + staticLibPathCmd += staticLibPath; + staticLibPathCmd += "'"; + linkerFlagCallbackFunc(staticLibPathCmd); // TODO: Use different directories depending on the project type, but .o build files should be in the same directory // no matter what project type, since they are used for executables, static/dynamic libraries diff --git a/src/PkgConfig.cpp b/src/PkgConfig.cpp index 3307ff1..5f85549 100644 --- a/src/PkgConfig.cpp +++ b/src/PkgConfig.cpp @@ -89,15 +89,15 @@ namespace sibs return Result::Ok(true); } - Result PkgConfig::getDynamicLibsLinkerFlags(const vector &libs) + Result PkgConfig::getDynamicLibsLinkerFlags(const vector &libs) { if(libs.empty()) return Result::Ok(""); string args; - for(const string &lib : libs) + for(const Dependency &lib : libs) { args += " '"; - args += lib; + args += lib.name; args += "'"; } -- cgit v1.2.3-70-g09d2