com php-src: Enable whole program optimization for builds without PGO, too: win32/build/confutils.js

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    f052e99df6f4b3bc4e2a1e9717ee36339a33f33b
Author:    Anatol Belski <[email protected]>         Tue, 11 Apr 2017 15:21:10 +0200
Parents:   e282c403c53ece634000e8c2c6a961debf37caf0
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=f052e99df6f4b3bc4e2a1e9717ee36339a33f33b

Log:
Enable whole program optimization for builds without PGO, too

Changed paths:
  M  win32/build/confutils.js


Diff:
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 43c2596..fd76340 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1221,6 +1221,9 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
 		}
 
 		ldflags += " /PGD:$(PGOPGD_DIR)\\" + makefiletarget.substring(0, makefiletarget.indexOf(".")) + ".pgd";
+	} else if (PHP_DEBUG != "yes") {
+		ADD_FLAG('CFLAGS_' + SAPI, "/GL");
+		ADD_FLAG('LDFLAGS_' + SAPI, "/LTCG");
 	}
 
 	if (MODE_PHPIZE) {
@@ -1421,6 +1424,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
 			ADD_FLAG('CFLAGS_' + EXT, "/GL /O2");
 
 			ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd";
+		} else if (PHP_DEBUG != "yes") {
+			ADD_FLAG('CFLAGS_' + EXT, "/GL");
+			ADD_FLAG('LDFLAGS_' + EXT, "/LTCG");
 		}
 
 		MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);
@@ -1463,6 +1469,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
 				ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
 				static_pgo_enabled = true;
 			}
+		} else if (PHP_DEBUG != "yes") {
+			ADD_FLAG("STATIC_EXT_CFLAGS", "/GL");
+			ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG");
 		}
 
 		/* find the header that declares the module pointer,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.