godotengine / godotengine/godot-cpp

Suggestion - colour output from SCons

Open
#1,036 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

It was suggested I open an issue for this. If you put `env["ENV"]["TERM"] = os.environ["TERM"]` in the SConstruct file, you can get colour output from the compiler if your terminal supports it. SCons doesn't pass terminal info to the build processes by default, cf. https://stackoverflow.com/questions/9922521/why-doesnt-clang-show-color-output-under-scons.

```diff
diff --git a/SConstruct b/SConstruct
index 27ee137..1608b91 100644
--- a/SConstruct
+++ b/SConstruct
@@ -54,6 +54,7 @@ else:
# Default tools with no platform defaults to gnu toolchain.
# We apply platform specific toolchains via our custom tools.
env = Environment(tools=["default"], PLATFORM="")
+env["ENV"]["TERM"] = os.environ["TERM"]

# Default num_jobs to local cpu count if not user specified.
# SCons has a peculiarity where user-specified options won't be overridden
```
It probably warrants a check for `if "TERM" in os.environ:`. Even if you don't really want it for building `godot-cpp` itself, I think a lot of beginners crib off or source the project's SConstruct file (as the example does, also I certainly did) and it might be nice QoL for them.

What do you think? I can open a PR if so.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.