aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2017-12-13 18:35:52 +0100
committerdec05eba <dec05eba@protonmail.com>2017-12-13 18:37:07 +0100
commit92f24893a5e2d12d0c32662483117c7032623bf1 (patch)
tree2fac67d414383465f1257a875d7a23ab3cfd9814 /backend/ninja
parentf2c70dfaba8d6481e86646080c51b6874d95f14e (diff)
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.
Diffstat (limited to 'backend/ninja')
-rw-r--r--backend/ninja/Ninja.cpp14
1 files changed, 8 insertions, 6 deletions
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<bool>::Err("NOT IMPLEMENTED YET!");
+ return Result<bool>::Err("Building a dynamic library is not supported yet");
}
vector<string> objectNames;
@@ -224,8 +225,9 @@ namespace backend
string allLinkerFlags;
Result<string> linkerFlags = getLinkerFlags(dependencies, [&allLinkerFlags](const string &linkerFlag)
{
- allLinkerFlags += " ";
+ allLinkerFlags += " '";
allLinkerFlags += linkerFlag;
+ allLinkerFlags += "'";
});
if(linkerFlags.isErr())
return Result<bool>::Err(linkerFlags.getErrMsg());
@@ -256,7 +258,7 @@ namespace backend
}
default:
assert(false);
- return Result<bool>::Err("NOT IMPLEMENTED YET!");
+ return Result<bool>::Err("Building a dynamic library is not supported yet");
}
Result<bool> fileOverwriteResult = sibs::fileOverwrite(ninjaBuildFilePath.c_str(), sibs::StringView(result.data(), result.size()));