diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-05-27 12:01:16 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-05 11:17:06 +0200 |
commit | 3a031e0b03f11b40b8b374472336d9a6df4d81b8 (patch) | |
tree | 15748a05502c6600262cf37e60b6ef7642fafeb3 /win32 | |
parent | 5a04796f760a9e4770ccca5006ec5076dec0450c (diff) | |
download | php-git-3a031e0b03f11b40b8b374472336d9a6df4d81b8.tar.gz |
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.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/build/confutils.js | 6 |
1 files changed, 3 insertions, 3 deletions
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 { |