diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-04 13:33:01 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-04 13:33:01 +0100 |
commit | 3655973e0e4d0f0c689e092603b1604f6adecdcd (patch) | |
tree | a31ab52577175bb8c701fdbffdeac2b805770607 /platform/windows | |
parent | 7be96a55c4ef177a59e796617c4e11ab8c564188 (diff) | |
parent | 9c674e26a02029f9efa158dfc694972065b20554 (diff) | |
download | redot-engine-3655973e0e4d0f0c689e092603b1604f6adecdcd.tar.gz |
Merge pull request #87154 from Repiteo/scons/cl-quiet
SCons: Silence redundant MSVC output
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/detect.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 4585884859..ca81bb615e 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -202,6 +202,7 @@ def get_opts(): BoolVariable("use_asan", "Use address sanitizer (ASAN)", False), BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False), BoolVariable("incremental_link", "Use MSVC incremental linking. May increase or decrease build times.", False), + BoolVariable("silence_msvc", "Silence MSVC's stdout. Decreases output log bloat by roughly half.", True), ("angle_libs", "Path to the ANGLE static libraries", ""), # Direct3D 12 support. ( @@ -392,6 +393,20 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config): ## Compile/link flags + env["MAXLINELENGTH"] = 8192 # Windows Vista and beyond, so always applicable. + + if env["silence_msvc"]: + env.Prepend(CCFLAGS=[">", "NUL"]) + env.Prepend(LINKFLAGS=[">", "NUL"]) + + # "> NUL" fails if using a tempfile, circumvent by removing the argument altogether. + old_esc_func = env["TEMPFILEARGESCFUNC"] + + def trim_nul(arg): + return "" if arg in [">", "NUL"] else old_esc_func(arg) + + env["TEMPFILEARGESCFUNC"] = trim_nul + if env["debug_crt"]: # Always use dynamic runtime, static debug CRT breaks thread_local. env.AppendUnique(CCFLAGS=["/MDd"]) |