Skip to content

Commit c97f912

Browse files
committed
Check for VSVERS >= 1929
According to Microsoft, ASan is already supported as of Visual Studio 16.9, but that support might be limited, and we can't easily check versions prior to 16.11 anyway, so we require 16.10 for now. We also move the `ARG_ENABLE` to the top-level, since `ARG_*` has special treatment by buildconf anyway, so there are no conditionally declared `ARG_*`s.
1 parent 743c48b commit c97f912

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

win32/build/config.w32

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,21 @@ if (PHP_SECURITY_FLAGS == "yes") {
355355
ADD_FLAG("LDFLAGS", "/NXCOMPAT /DYNAMICBASE ");
356356
}
357357

358-
if (CLANG_TOOLSET) {
358+
ARG_ENABLE("sanitizer", "Enable ASan and UBSan extensions", "no");
359+
if (VS_TOOLSET) {
360+
if (PHP_SANITIZER == "yes") {
361+
if (COMPILER_NUMERIC_VERSION < 1929) {
362+
ERROR("MSVC at least 16.0 required for sanitation plugins");
363+
}
364+
}
365+
} else if (CLANG_TOOLSET) {
359366
ARG_WITH("uncritical-warn-choke", "Disable some uncritical warnings", "yes");
360367
if (PHP_UNCRITICAL_WARN_CHOKE != "no") {
361368
ADD_FLAG("CFLAGS", "-Wno-ignored-attributes -Wno-deprecated-declarations -Wno-missing-braces " +
362369
"-Wno-logical-op-parentheses -Wno-msvc-include -Wno-invalid-source-encoding -Wno-unknown-pragmas " +
363370
"-Wno-unused-command-line-argument -Wno-unused-function -Wno-ignored-pragma-optimize");
364371
}
365372

366-
ARG_ENABLE("sanitizer", "Enable ASan and UBSan extensions", "no");
367373
if (PHP_SANITIZER == "yes") {
368374
if (COMPILER_NUMERIC_VERSION < 500) {
369375
ERROR("Clang at least 5.0.0 required for sanitation plugins");

0 commit comments

Comments
 (0)