From 3a031e0b03f11b40b8b374472336d9a6df4d81b8 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 27 May 2020 12:01:16 +0200 Subject: Drop hard-coded /W3 default in favor of custom CFLAGS Building with `/W3` shows an awful lot of warnings on Windows, so it's really hard to spot the more important ones. Since it is not possible to override the hard-coded `/W3`, we drop it altogether, so MSVC uses the default `/W1`. Users are encouraged to increase the warning level via the environment variable `CFLAGS` before doing configure. We also enable `/WX` (treat warnings as errors) for AppVeyor CI, using `/W1` for now, since otherwise the build would fail. --- win32/build/confutils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'win32') diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 9166cdeab6..9d2d578516 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3207,7 +3207,7 @@ function toolset_setup_common_cflags() // General CFLAGS for building objects DEFINE("CFLAGS", "/nologo $(BASE_INCLUDES) /D _WINDOWS /D WINDOWS=1 \ - /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 \ + /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS \ /D _USE_MATH_DEFINES"); if (envCFLAGS) { @@ -3399,7 +3399,7 @@ function toolset_setup_common_libs() function toolset_setup_build_mode() { if (PHP_DEBUG == "yes") { - ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Od /D _DEBUG /D ZEND_DEBUG=1 " + + ADD_FLAG("CFLAGS", "/LDd /MDd /Od /D _DEBUG /D ZEND_DEBUG=1 " + (X64?"/Zi":"/ZI")); ADD_FLAG("LDFLAGS", "/debug"); // Avoid problems when linking to release libraries that use the release @@ -3411,7 +3411,7 @@ function toolset_setup_build_mode() ADD_FLAG("CFLAGS", "/Zi"); ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf"); } - ADD_FLAG("CFLAGS", "/LD /MD /W3"); + ADD_FLAG("CFLAGS", "/LD /MD"); if (PHP_SANITIZER == "yes" && CLANG_TOOLSET) { ADD_FLAG("CFLAGS", "/Od /D NDebug /D NDEBUG /D ZEND_WIN32_NEVER_INLINE /D ZEND_DEBUG=0"); } else { -- cgit v1.2.1