aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-09-24 15:57:53 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit0bbb9be629ce35c11e4bf4a5180810ae2b16e5b4 (patch)
tree1a5904f36619385c99a4f88a76dc6db29694c0a2 /src
parentf71886d54dddbf92c64f8c48978b7c4c60090194 (diff)
Fix TODOs, mainly escaping strings for ninja
Diffstat (limited to 'src')
-rw-r--r--src/PkgConfig.cpp2
-rw-r--r--src/main.cpp10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/PkgConfig.cpp b/src/PkgConfig.cpp
index 42d0d13..3a36f39 100644
--- a/src/PkgConfig.cpp
+++ b/src/PkgConfig.cpp
@@ -6,7 +6,7 @@
using namespace std;
// TODO: Do not use pkg-config program. The same functionality can easily be achieved
-// by reading files in /usr/bin/pkgconfig
+// by reading files in /usr/share/pkgconfig
// Or is there no downside to calling pkg-config program?
namespace sibs
{
diff --git a/src/main.cpp b/src/main.cpp
index 12d3bc4..38e68f0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -182,7 +182,7 @@ void usageInit()
printf(" --dynamic\t\t\tProject compiles to a dynamic library\n");
printf(" --lang\t\t\tProject template language - Optional (default: c++)\n");
printf("Examples:\n");
- printf(" sibs init --exec\n");
+ printf(" sibs init . --exec\n");
printf(" sibs init dirA/dirB --dynamic");
exit(1);
}
@@ -226,6 +226,14 @@ bool isPathSubPathOf(const FileString &path, const FileString &subPathOf)
return _tinydir_strncmp(path.c_str(), subPathOf.c_str(), subPathOf.size()) == 0;
}
+static bool doesProgramExist(const _tinydir_char_t *programName)
+{
+ FileString cmd = FileString(programName) + TINYDIR_STRING(" --version");
+ Result<sibs::ExecResult> result = exec(cmd.c_str());
+ bool programNotFound = !result && result.getErrorCode() == 127;
+ return !programNotFound;
+}
+
int buildProject(const FileString &projectPath, const FileString &projectConfFilePath, SibsConfig &sibsConfig)
{
FileString buildPath;