summaryrefslogtreecommitdiffstats
path: root/platform/windows/detect.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows/detect.py')
-rw-r--r--platform/windows/detect.py41
1 files changed, 22 insertions, 19 deletions
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 8e1abba3bb..3671bbef08 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -214,11 +214,6 @@ def get_opts():
os.path.join(d3d12_deps_folder, "mesa"),
),
(
- "dxc_path",
- "Path to the DirectX Shader Compiler distribution (required for D3D12)",
- os.path.join(d3d12_deps_folder, "dxc"),
- ),
- (
"agility_sdk_path",
"Path to the Agility SDK distribution (optional for D3D12)",
os.path.join(d3d12_deps_folder, "agility_sdk"),
@@ -306,7 +301,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 +333,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"]))
@@ -500,6 +500,14 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
if env["arch"] == "x86_64":
env.AppendUnique(CPPDEFINES=["_WIN64"])
+ # Sanitizers
+ prebuilt_lib_extra_suffix = ""
+ if env["use_asan"]:
+ env.extra_suffix += ".san"
+ prebuilt_lib_extra_suffix = ".san"
+ env.Append(CCFLAGS=["/fsanitize=address"])
+ env.Append(LINKFLAGS=["/INFERASANLIBS"])
+
## Libs
LIBS = [
@@ -567,7 +575,7 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
LIBS += ["WinPixEventRuntime"]
env.Append(LIBPATH=[env["mesa_libs"] + "/bin"])
- LIBS += ["libNIR.windows." + env["arch"]]
+ LIBS += ["libNIR.windows." + env["arch"] + prebuilt_lib_extra_suffix]
if env["opengl3"]:
env.AppendUnique(CPPDEFINES=["GLES3_ENABLED"])
@@ -575,11 +583,11 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
env.AppendUnique(CPPDEFINES=["EGL_STATIC"])
env.Append(LIBPATH=[env["angle_libs"]])
LIBS += [
- "libANGLE.windows." + env["arch"],
- "libEGL.windows." + env["arch"],
- "libGLES.windows." + env["arch"],
+ "libANGLE.windows." + env["arch"] + prebuilt_lib_extra_suffix,
+ "libEGL.windows." + env["arch"] + prebuilt_lib_extra_suffix,
+ "libGLES.windows." + env["arch"] + prebuilt_lib_extra_suffix,
]
- LIBS += ["dxgi", "d3d9", "d3d11"]
+ LIBS += ["dxgi", "d3d9", "d3d11", "synchronization"]
env.Prepend(CPPPATH=["#thirdparty/angle/include"])
if env["target"] in ["editor", "template_debug"]:
@@ -613,12 +621,6 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
env.Prepend(CPPPATH=[p for p in str(os.getenv("INCLUDE")).split(";")])
env.Append(LIBPATH=[p for p in str(os.getenv("LIB")).split(";")])
- # Sanitizers
- if env["use_asan"]:
- env.extra_suffix += ".san"
- env.Append(LINKFLAGS=["/INFERASANLIBS"])
- env.Append(CCFLAGS=["/fsanitize=address"])
-
# Incremental linking fix
env["BUILDERS"]["ProgramOriginal"] = env["BUILDERS"]["Program"]
env["BUILDERS"]["Program"] = methods.precious_program
@@ -642,7 +644,8 @@ def configure_mingw(env: "SConsEnvironment"):
# TODO: Re-evaluate the need for this / streamline with common config.
if env["target"] == "template_release":
- env.Append(CCFLAGS=["-msse2"])
+ if env["arch"] != "arm64":
+ env.Append(CCFLAGS=["-msse2"])
elif env.dev_build:
# Allow big objects. It's supposed not to have drawbacks but seems to break
# GCC LTO, so enabling for debug builds only (which are not built with LTO
@@ -810,7 +813,7 @@ def configure_mingw(env: "SConsEnvironment"):
"ANGLE.windows." + env["arch"],
]
)
- env.Append(LIBS=["dxgi", "d3d9", "d3d11"])
+ env.Append(LIBS=["dxgi", "d3d9", "d3d11", "synchronization"])
env.Prepend(CPPPATH=["#thirdparty/angle/include"])
env.Append(CPPDEFINES=["MINGW_ENABLED", ("MINGW_HAS_SECURE_API", 1)])