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.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 0ad84240e4..fee306a25c 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -142,8 +142,9 @@ def detect_build_env_arch():
if os.getenv("VCTOOLSINSTALLDIR"):
host_path_index = os.getenv("PATH").upper().find(os.getenv("VCTOOLSINSTALLDIR").upper() + "BIN\\HOST")
if host_path_index > -1:
- first_path_arch = os.getenv("PATH").split(";")[0].rsplit("\\", 1)[-1].lower()
- return msvc_target_aliases[first_path_arch]
+ first_path_arch = os.getenv("PATH")[host_path_index:].split(";")[0].rsplit("\\", 1)[-1].lower()
+ if first_path_arch in msvc_target_aliases.keys():
+ return msvc_target_aliases[first_path_arch]
msys_target_aliases = {
"mingw32": "x86_32",
@@ -499,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 = [
@@ -566,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"])
@@ -574,9 +583,9 @@ 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"]
env.Prepend(CPPPATH=["#thirdparty/angle/include"])
@@ -612,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