Browse Source

Add support for whole program optimization on MSVC

Since it's similar to LTO, it can be enabled by setting use_lto=yes.
George Marques 7 years ago
parent
commit
f1683a290b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      platform/windows/detect.py

+ 3 - 0
platform/windows/detect.py

@@ -188,6 +188,9 @@ def configure(env):
         else:
         else:
             VC_PATH = ""
             VC_PATH = ""
 
 
+        if (env["use_lto"]):
+            env.Append(CCFLAGS=['/GL'])
+            env.Append(LINKFLAGS=['/LTCG'])
         if (env["openmp"]):
         if (env["openmp"]):
             env.Append(CPPFLAGS=['/openmp'])
             env.Append(CPPFLAGS=['/openmp'])