From d1eebd34936d062896e0f7cd1d527557fd15768f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Fri, 14 Jun 2024 14:06:38 +0200 Subject: [PATCH] Enable usage of asan-enabled versions of prebuilt libraries --- platform/windows/detect.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 5092c6fadff..6ba92de8aa5 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -499,6 +499,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 +574,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 +582,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 +620,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