From 05b3295a570bd4f605dd3959f8abd4df1c7f7261 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 10 Apr 2017 13:10:56 +0200 Subject: write Libs.private to .pc files only in static builds projects using a dynamic build are not supposed to access this variable anyway. Task-number: QTBUG-51598 Change-Id: I81b55ea9ba460b80919f40ed7fe3d52129636b9e Reviewed-by: Michal Klocek Reviewed-by: Jonathan Liu --- qmake/generators/makefile.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 2845888dde..5bd2bcd4f6 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3310,19 +3310,19 @@ MakefileGenerator::writePkgConfigFile() } t << shellQuote(pkgConfiglibName) << " \n"; - ProStringList libs; - if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) { - libs = project->values("QMAKE_INTERNAL_PRL_LIBS"); - } else { - libs << "QMAKE_LIBS"; //obvious one - } - libs << "QMAKE_LIBS_PRIVATE"; - libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? - t << "Libs.private: "; - for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) { - t << fixLibFlags((*it).toKey()).join(' ') << ' '; + if (project->isActiveConfig("staticlib")) { + ProStringList libs; + if (!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) + libs = project->values("QMAKE_INTERNAL_PRL_LIBS"); + else + libs << "QMAKE_LIBS"; //obvious one + libs << "QMAKE_LIBS_PRIVATE"; + libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? + t << "Libs.private:"; + for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) + t << ' ' << fixLibFlags((*it).toKey()).join(' '); + t << endl; } - t << endl; // flags // ### too many -- cgit v1.2.3