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 <michal.klocek@qt.io>
Reviewed-by: Jonathan Liu <net147@gmail.com>
This commit is contained in:
Oswald Buddenhagen 2017-04-10 13:10:56 +02:00
parent 850c5dbcd3
commit 05b3295a57

View File

@ -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
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;
}
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;
// flags
// ### too many