diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-09-29 12:44:30 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-10-01 16:19:30 +0000 |
commit | f734599629ca30866fcefcc1cfea72a2d77462c3 (patch) | |
tree | 180023dd76f0e7fec2884f8393cd4e94c57c19fd /qmake/generators/win32 | |
parent | 3e6d1726380326c0faba9029e2a68886595a2ebc (diff) |
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 <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 8 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.h | 1 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 15 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.h | 1 |
4 files changed, 5 insertions, 20 deletions
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; }; |