From 0f691efb1b5946b94802f1a0d43a7baa3cace841 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Mon, 8 Jul 2024 09:48:18 -0500 Subject: [PATCH] SCons: Don't override cl flags on msvc --- platform/windows/detect.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index fee306a25c3..fa948464168 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -306,7 +306,6 @@ def setup_msvc_manual(env: "SConsEnvironment"): print("Using VCVARS-determined MSVC, arch %s" % (env_arch)) -# FIXME: Likely overwrites command-line options for the msvc compiler. See #91883. def setup_msvc_auto(env: "SConsEnvironment"): """Set up MSVC using SCons's auto-detection logic""" @@ -339,6 +338,12 @@ def setup_msvc_auto(env: "SConsEnvironment"): env.Tool("msvc") env.Tool("mssdk") # we want the MS SDK + # Re-add potentially overwritten flags. + env.AppendUnique(CCFLAGS=env.get("ccflags", "").split()) + env.AppendUnique(CXXFLAGS=env.get("cxxflags", "").split()) + env.AppendUnique(CFLAGS=env.get("cflags", "").split()) + env.AppendUnique(RCFLAGS=env.get("rcflags", "").split()) + # Note: actual compiler version can be found in env['MSVC_VERSION'], e.g. "14.1" for VS2015 print("Using SCons-detected MSVC version %s, arch %s" % (env["MSVC_VERSION"], env["arch"]))