diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-01-14 18:47:05 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-01-26 09:13:15 +0100 |
commit | bf2527a301d6048816958f92129289258ba5991d (patch) | |
tree | ebd62b67c14eb354e7162d78f9cd28dbc7076029 | |
parent | 91ab79f1475371e6e57d00f24f98bccb7749d15a (diff) |
Use 'script' to get colored output for ninja build
-rw-r--r-- | backend/ninja/Ninja.cpp | 7 |
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()) { |