Skip to content

Commit 75d7684

Browse files
authored
Remove useless compiler options (phpGH-17553)
* `/Fp` provides a path name for procompiled headers[1], but we don't use these. * `/FR` is used to generate .sbr files; these have been important long ago for Visual Studio support, but as of Visual Studio 2008 the IDE no longer uses .sbr files. * `/LD` is used to inform the *compiler* that it should build a DLL[3]; however, we build all DLLs with the *linker*. [1] <https://learn.microsoft.com/en-us/cpp/build/reference/fp-name-dot-pch-file> [2] <https://learn.microsoft.com/en-us/cpp/build/reference/fr-fr-create-dot-sbr-file> [3] <https://learn.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library>
1 parent 5890761 commit 75d7684

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

win32/build/confutils.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,6 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
16701670
var mangle_dir = k.replace(new RegExp("[\\\\/.-]", "g"), "_");
16711671
var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase();
16721672

1673-
DEFINE(bd_flags_name, "/Fp" + sub_build + d + " /FR" + sub_build + d + " ");
16741673
if (VS_TOOLSET) {
16751674
ADD_FLAG(bd_flags_name, "/Fd" + sub_build + d);
16761675
}
@@ -2474,15 +2473,12 @@ function handle_analyzer_makefile_flags(fd, key, val)
24742473

24752474
if ("clang" == PHP_ANALYZER) {
24762475
val = val.replace(/\/FD /, "")
2477-
.replace(/\/Fp.+? /, "")
24782476
.replace(/\/Fo.+? /, "")
24792477
.replace(/\/Fd.+? /, "")
24802478
//.replace(/\/Fd.+?/, " ")
2481-
.replace(/\/FR.+? /, "")
24822479
.replace("/guard:cf ", "")
24832480
.replace(/\/MP \d+ /, "")
24842481
.replace(/\/MP /, "")
2485-
.replace("/LD ", "")
24862482
.replace("/Qspectre ", "");
24872483
} else if ("cppcheck" == PHP_ANALYZER) {
24882484
new_val = "";
@@ -3449,7 +3445,7 @@ function toolset_setup_common_libs()
34493445
function toolset_setup_build_mode()
34503446
{
34513447
if (PHP_DEBUG == "yes") {
3452-
ADD_FLAG("CFLAGS", "/LDd /MDd /Od /U NDebug /U NDEBUG /D ZEND_DEBUG=1 " +
3448+
ADD_FLAG("CFLAGS", "/MDd /Od /U NDebug /U NDEBUG /D ZEND_DEBUG=1 " +
34533449
(TARGET_ARCH == 'x86'?"/ZI":"/Zi"));
34543450
ADD_FLAG("LDFLAGS", "/debug");
34553451
// Avoid problems when linking to release libraries that use the release
@@ -3461,7 +3457,7 @@ function toolset_setup_build_mode()
34613457
ADD_FLAG("CFLAGS", "/Zi");
34623458
ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
34633459
}
3464-
ADD_FLAG("CFLAGS", "/LD /MD");
3460+
ADD_FLAG("CFLAGS", "/MD");
34653461
if (PHP_SANITIZER == "yes") {
34663462
if (VS_TOOLSET) {
34673463
ADD_FLAG("CFLAGS", "/Ox /U NDebug /U NDEBUG /D ZEND_DEBUG=1");

0 commit comments

Comments
 (0)