diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2008-10-20 07:59:51 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-17 10:48:24 (GMT) |
commit | 5bc8c27e9406fd55693e3a3963030c6d9a89b08a (patch) | |
tree | 94beac30107d3b09550094a0e00e6c26b01eb5d1 /qmake/generators/unix | |
parent | 8096d2bbbb1f4becaaefe2219560f8dd558235de (diff) | |
download | Qt-5bc8c27e9406fd55693e3a3963030c6d9a89b08a.zip Qt-5bc8c27e9406fd55693e3a3963030c6d9a89b08a.tar.gz Qt-5bc8c27e9406fd55693e3a3963030c6d9a89b08a.tar.bz2 |
Add LIBS_PRIVATE to qmake.
The difference between LIBS and LIBS_PRIVATE is that private libraries
are those that are not part of the public interface of a library. For
example, if you're writing a Qt application and link to QtGui, you
definitely need the development files for QtCore, but not necessarily
for Glib and GThread, or maybe even X11.
The private libraries are necessary only in static builds, so the
information should still be published in .prl and pkg-config files.
Reviewed-By: Marius Storm-Olsen
Diffstat (limited to 'qmake/generators/unix')
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 3 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 18 |
2 files changed, 12 insertions, 9 deletions
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 36470f2..626b955a5 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -127,6 +127,7 @@ UnixMakefileGenerator::init() project->values("QMAKE_ORIG_TARGET") = project->values("TARGET"); project->values("QMAKE_ORIG_DESTDIR") = project->values("DESTDIR"); project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS")); + project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); if((!project->isEmpty("QMAKE_LIB_FLAG") && !project->isActiveConfig("staticlib")) || (project->isActiveConfig("qt") && project->isActiveConfig("plugin"))) { if(configs.indexOf("dll") == -1) configs.append("dll"); @@ -441,7 +442,7 @@ UnixMakefileGenerator::findLibraries() QList<QMakeLocalFileName> libdirs, frameworkdirs; frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); - const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; + const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", QString() }; for(int i = 0; !lflags[i].isNull(); i++) { QStringList &l = project->values(lflags[i]); for(QStringList::Iterator it = l.begin(); it != l.end(); ++it) { diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index b8252b8..07c7d38 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -149,7 +149,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "LINK = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_FRAMEWORKDIR_FLAGS") << " " - << var("QMAKE_LIBDIR_FLAGS") << " " << var("QMAKE_LIBS") << endl; + << var("QMAKE_LIBDIR_FLAGS") << " " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl; } t << "AR = " << var("QMAKE_AR") << endl; @@ -1424,13 +1424,6 @@ UnixMakefileGenerator::writePkgConfigFile() t << "Version: " << project->first("VERSION") << endl; // libs - QStringList libs; - if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) { - libs = project->values("QMAKE_INTERNAL_PRL_LIBS"); - } else { - libs << "QMAKE_LIBS"; //obvious one - } - libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? t << "Libs: "; QString pkgConfiglibDir; QString pkgConfiglibName; @@ -1450,6 +1443,15 @@ UnixMakefileGenerator::writePkgConfigFile() pkgConfiglibName = "-l" + lname.left(lname.length()-Option::libtool_ext.length()); } t << pkgConfiglibDir << " " << pkgConfiglibName << " " << endl; + + QStringList 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(QStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) { t << project->values((*it)).join(" ") << " "; |