From 92f24893a5e2d12d0c32662483117c7032623bf1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 13 Dec 2017 18:35:52 +0100 Subject: Fix linking issue (linking in wrong order) Change program argument handling. Add new program argument "new" to create a new sibs project which creates a project with all necessary files and also uses git init (ignores failure, for example if git is not installed). Change build path from "build" to "sibs-build" to prevent name clashing since "build" is a common name for directories. --- backend/ninja/Ninja.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'backend') diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 7fb07bf..87dd873 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -129,9 +129,9 @@ namespace backend } } - globalLibLinkerFlags += " "; + globalLibLinkerFlags += " '"; globalLibLinkerFlags += globalLibLinkerFlagsResult.unwrap(); - // TODO: If package doesn't exist, download it from github/server + globalLibLinkerFlags += "'"; } } @@ -139,7 +139,8 @@ namespace backend if(pkgConfigLinkerFlagsResult.isErr()) return pkgConfigLinkerFlagsResult; - linkerFlagCallbackFunc(pkgConfigLinkerFlagsResult.unwrap()); + if(!pkgConfigLinkerFlagsResult.unwrap().empty()) + linkerFlagCallbackFunc(pkgConfigLinkerFlagsResult.unwrap()); string allLinkerFlags = pkgConfigLinkerFlagsResult.unwrap(); allLinkerFlags += globalLibLinkerFlags; @@ -193,7 +194,7 @@ namespace backend } default: assert(false); - return Result::Err("NOT IMPLEMENTED YET!"); + return Result::Err("Building a dynamic library is not supported yet"); } vector objectNames; @@ -224,8 +225,9 @@ namespace backend string allLinkerFlags; Result linkerFlags = getLinkerFlags(dependencies, [&allLinkerFlags](const string &linkerFlag) { - allLinkerFlags += " "; + allLinkerFlags += " '"; allLinkerFlags += linkerFlag; + allLinkerFlags += "'"; }); if(linkerFlags.isErr()) return Result::Err(linkerFlags.getErrMsg()); @@ -256,7 +258,7 @@ namespace backend } default: assert(false); - return Result::Err("NOT IMPLEMENTED YET!"); + return Result::Err("Building a dynamic library is not supported yet"); } Result fileOverwriteResult = sibs::fileOverwrite(ninjaBuildFilePath.c_str(), sibs::StringView(result.data(), result.size())); -- cgit v1.2.3