From 5dc8a4d7d85baf2d357e7c5e754b6e5e5eedb2f8 Mon Sep 17 00:00:00 2001 From: Tomasz Konojacki Date: Mon, 14 Oct 2024 00:35:30 +0200 Subject: [PATCH] win32/Makefile: update compilation flags for Visual C++ Makefile contains the following comment from 2002: # -O1 yields smaller code, which turns out to be faster than -O2 Visual C++ documentation says that -O2 "creates fast code", while -O1 "creates small code". It's unlikely that, after 20 years, -O2 still generates worse code. If it does, it should be reported to Microsoft. Also added -Gw (optimize global data). --- win32/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win32/Makefile b/win32/Makefile index e4882bc36b42..9974b4118cb2 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -455,8 +455,7 @@ DEFINES = $(DEFINES) -D_DEBUG -DDEBUGGING EXTRACFLAGS = $(EXTRACFLAGS) -MDd !ELSE # Enable Whole Program Optimizations (WPO) and Link Time Code Generation (LTCG). -# -O1 yields smaller code, which turns out to be faster than -O2 on x86 and x64 -OPTIMIZE = -O1 -Zi -GL +OPTIMIZE = -O2 -Zi -GL -Gw # we enable debug symbols in release builds also LINK_DBG = -debug -opt:ref,icf -ltcg # you may want to enable this if you want COFF symbols in the executables