aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-14 18:47:05 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-26 09:13:15 +0100
commitbf2527a301d6048816958f92129289258ba5991d (patch)
treeebd62b67c14eb354e7162d78f9cd28dbc7076029 /backend/ninja
parent91ab79f1475371e6e57d00f24f98bccb7749d15a (diff)
Use 'script' to get colored output for ninja build
Diffstat (limited to 'backend/ninja')
-rw-r--r--backend/ninja/Ninja.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 0ca7c7a..06345d9 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -973,9 +973,16 @@ namespace backend
Result<bool> Ninja::compile(const _tinydir_char_t *buildFilePath)
{
+ // TODO: Verify `script` is installed. We need `script` to get colored output
+#if OS_FAMILY == OS_FAMILY_POSIX
+ FileString command = TINYDIR_STRING("script -eqc 'ninja -C \"");
+ command += buildFilePath;
+ command += TINYDIR_STRING("\"' /dev/null");
+#else
FileString command = TINYDIR_STRING("ninja -C \"");
command += buildFilePath;
command += TINYDIR_STRING("\"");
+#endif
Result<ExecResult> execResult = exec(command.c_str(), true);
if(execResult.isOk())
{