aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 8b815cb..fad1d35 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -12,6 +12,7 @@ using namespace std;
using namespace sibs;
#if OS_FAMILY == OS_FAMILY_POSIX
+#include <unistd.h>
#define nprintf printf
#else
#define nprintf wprintf
@@ -1889,9 +1890,19 @@ namespace backend
Result<bool> Ninja::compile(const _tinydir_char_t *buildFilePath)
{
#if OS_TYPE == OS_TYPE_LINUX
- FileString command = TINYDIR_STRING("script -eqc 'ninja -C \"");
- command += buildFilePath;
- command += TINYDIR_STRING("\"' /dev/null");
+ FileString command;
+ if(isatty(STDOUT_FILENO) == 1)
+ {
+ command = TINYDIR_STRING("script -eqc 'ninja -C \"");
+ command += buildFilePath;
+ command += TINYDIR_STRING("\"' /dev/null");
+ }
+ else
+ {
+ command = TINYDIR_STRING("ninja -C \"");
+ command += buildFilePath;
+ command += TINYDIR_STRING("\"");
+ }
#else
FileString command = TINYDIR_STRING("ninja -C \"");
command += buildFilePath;