From 7c19b28c58cc992f5c041b8f6369d92dcc138917 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20K=C3=BCmmel?= <syntheticpp@gmx.net>
Date: Sat, 31 Oct 2015 17:23:23 +0100
Subject: [PATCH] configure: set ltcg only for Qt modules

Adding ltcg to qconfig.pri enables ltcg
unconditionally for everyone using msvc.

Change-Id: Ie1d11612a10fcdcb27de41664141e661a17323dd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
---
 tools/configure/configureapp.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 6c3217baeb2..5ddb3cb4898 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3136,7 +3136,7 @@ void Configure::generateOutputVars()
 
 void Configure::generateCachefile()
 {
-    // Generate qmodule.pri
+    // Generate qmodule.pri, which is loaded only by Qt modules
     {
         FileWriter moduleStream(buildPath + "/mkspecs/qmodule.pri");
 
@@ -3204,6 +3204,8 @@ void Configure::generateCachefile()
             moduleStream << " largefile";
         if (dictionary[ "STRIP" ] == "no")
             moduleStream << " nostrip";
+        if (dictionary[ "LTCG" ] == "yes")
+            moduleStream << " ltcg";
         moduleStream << endl;
 
         for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var)
@@ -3491,8 +3493,6 @@ void Configure::generateQConfigPri()
 
         if (dictionary["STATIC_RUNTIME"] == "yes")
             configStream << " static_runtime";
-        if (dictionary[ "LTCG" ] == "yes")
-            configStream << " ltcg";
         if (dictionary[ "RTTI" ] == "yes")
             configStream << " rtti";
         if (dictionary["INCREDIBUILD_XGE"] == "yes")
-- 
GitLab