From f734599629ca30866fcefcc1cfea72a2d77462c3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 29 Sep 2015 12:44:30 +0200 Subject: unify handling of library prefixes and extensions make sure that all specs define QMAKE_{PREFIX,EXTENSION}_{SH,STATIC}LIB, and adjust the code to make halfways consistent use of these variables, in particular on windows; Win32MakefileGenerator::getLibTarget() is gone as a result, as is QMAKE_CYGWIN_SHLIB. still, tons of hardcoded "lib" references remain in the unix generator, because no-one cares. Change-Id: I6ccf37cc562f6584221c94fa27b2834412e4e4ca Reviewed-by: Joerg Bornemann --- qmake/generators/unix/unixmake.cpp | 10 ---------- qmake/generators/win32/mingw_make.cpp | 8 +------- qmake/generators/win32/mingw_make.h | 1 - qmake/generators/win32/winmakefile.cpp | 15 ++++----------- qmake/generators/win32/winmakefile.h | 1 - 5 files changed, 5 insertions(+), 30 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 56e31922d1..1a1ba58dd1 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -45,14 +45,6 @@ QT_BEGIN_NAMESPACE void UnixMakefileGenerator::init() { - if(project->isEmpty("QMAKE_EXTENSION_SHLIB")) { - if(project->isEmpty("QMAKE_CYGWIN_SHLIB")) { - project->values("QMAKE_EXTENSION_SHLIB").append("so"); - } else { - project->values("QMAKE_EXTENSION_SHLIB").append("dll"); - } - } - ProStringList &configs = project->values("CONFIG"); if(project->isEmpty("ICON") && !project->isEmpty("RC_FILE")) project->values("ICON") = project->values("RC_FILE"); @@ -702,7 +694,6 @@ UnixMakefileGenerator::defaultInstall(const QString &t) } else if(project->first("TEMPLATE") == "app") { target = "$(QMAKE_TARGET)"; } else if(project->first("TEMPLATE") == "lib") { - if(project->isEmpty("QMAKE_CYGWIN_SHLIB")) { if (!project->isActiveConfig("staticlib") && !project->isActiveConfig("plugin") && !project->isActiveConfig("unversioned_libname")) { @@ -712,7 +703,6 @@ UnixMakefileGenerator::defaultInstall(const QString &t) links << "$(TARGET0)"; } } - } } for(int i = 0; i < targets.size(); ++i) { QString src = targets.at(i).toQString(), diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 87213a0e72..88a4494ec4 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -56,11 +56,6 @@ QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const return ret; } -QString MingwMakefileGenerator::getLibTarget() -{ - return QString("lib" + project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".a"); -} - QString MingwMakefileGenerator::getManifestFileForRcFile() const { return project->first("QMAKE_MANIFEST").toQString(); @@ -230,8 +225,7 @@ void MingwMakefileGenerator::init() QString destDir = ""; if(!project->first("DESTDIR").isEmpty()) destDir = Option::fixPathToTargetOS(project->first("DESTDIR") + Option::dir_sep, false, false); - project->values("MINGW_IMPORT_LIB").prepend(destDir + "lib" + project->first("TARGET") - + project->first("TARGET_VERSION_EXT") + ".a"); + project->values("MINGW_IMPORT_LIB").prepend(destDir + project->first("LIB_TARGET")); project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + fileVar("MINGW_IMPORT_LIB")); } diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h index e76391080c..73018319bc 100644 --- a/qmake/generators/win32/mingw_make.h +++ b/qmake/generators/win32/mingw_make.h @@ -47,7 +47,6 @@ protected: QString escapeDependencyPath(const QString &path) const; ProString escapeDependencyPath(const ProString &path) const { return MakefileGenerator::escapeDependencyPath(path); } virtual ProString fixLibFlag(const ProString &lib); - QString getLibTarget(); virtual QString getManifestFileForRcFile() const; bool writeMakefile(QTextStream &); void init(); diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 55da3d579e..07e3531420 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -318,14 +318,12 @@ void Win32MakefileGenerator::processVars() void Win32MakefileGenerator::fixTargetExt() { - if (project->isEmpty("QMAKE_EXTENSION_STATICLIB")) - project->values("QMAKE_EXTENSION_STATICLIB").append("lib"); - if (project->isEmpty("QMAKE_EXTENSION_SHLIB")) - project->values("QMAKE_EXTENSION_SHLIB").append("dll"); - if (!project->values("QMAKE_APP_FLAG").isEmpty()) { project->values("TARGET_EXT").append(".exe"); } else if (project->isActiveConfig("shared")) { + project->values("LIB_TARGET").prepend(project->first("QMAKE_PREFIX_STATICLIB") + + project->first("TARGET") + project->first("TARGET_VERSION_EXT") + + '.' + project->first("QMAKE_EXTENSION_STATICLIB")); project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + "." + project->first("QMAKE_EXTENSION_SHLIB")); project->values("TARGET").first() = project->first("QMAKE_PREFIX_SHLIB") + project->first("TARGET"); @@ -782,11 +780,6 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t) } } -QString Win32MakefileGenerator::getLibTarget() -{ - return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".lib"); -} - QString Win32MakefileGenerator::defaultInstall(const QString &t) { if((t != "target" && t != "dlltarget") || @@ -833,7 +826,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t) } } if(project->isActiveConfig("shared") && !project->isActiveConfig("plugin")) { - QString lib_target = getLibTarget(); + ProString lib_target = project->first("LIB_TARGET"); QString src_targ = escapeFilePath( (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + lib_target); diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h index ea763c3175..d09ec4259d 100644 --- a/qmake/generators/win32/winmakefile.h +++ b/qmake/generators/win32/winmakefile.h @@ -66,7 +66,6 @@ protected: void processVars(); void fixTargetExt(); void processRcFileVar(); - virtual QString getLibTarget(); static QString cQuoted(const QString &str); virtual QString getManifestFileForRcFile() const; }; -- cgit v1.2.3