浏览代码

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 年之前
父节点
当前提交
f1683a290b
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      platform/windows/detect.py

+ 3 - 0
platform/windows/detect.py

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