Allow cross-building 64 bit binaries for Windows

This also makes sure that we package the Qt5 translations, not the Qt4
translations.

There was an odd issue that somehow a 32bit search path ended up being
used by win-dll which resulted in the wrong DLLs being packaged.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-08-02 15:06:10 -07:00
parent a104905257
commit 6c15647858
4 changed files with 28 additions and 9 deletions

View file

@ -14,10 +14,28 @@ BASEDIR=$(dirname $0)
rm $BASEDIR/subsurface.nsi > /dev/null 2>&1
rm $BASEDIR/../../ssrf-version.h > /dev/null 2>&1
export PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
if [[ $1 == "Qt5-64" ]] ; then
export PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH
else
export PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
fi
export objdump=mingw-objdump
if [[ $1 == "Qt5" ]] ; then
if [[ $1 == "Qt5-64" ]] ; then
shift
mingw64-qmake-qt5 \
CROSS_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw \
QMAKE_LRELEASE=/usr/x86_64-w64-mingw32/bin/qt5/lrelease \
QMAKE_MOC=/usr/x86_64-w64-mingw32/bin/qt5/moc \
QMAKE_UIC=/usr/x86_64-w64-mingw32/bin/qt5/uic \
QMAKE_RCC=/usr/x86_64-w64-mingw32/bin/qt5/rcc \
LIBDCDEVEL=../libdivecomputer \
LIBMARBLEDEVEL=../marble \
LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
QMAKE_LIBDIR+=../openssl \
$BASEDIR/../../subsurface.pro
elif [[ $1 == "Qt5" ]] ; then
shift
mingw32-qmake-qt5 \
CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw \

View file

@ -4,10 +4,6 @@
# This installer creator needs to be run with:
# makensis subsurface.nsi
#
# It assumes that packaging/windows/dll is a symlink to
# the directory in which the required Windows DLLs are installed
# (in my case that's /usr/i686-w64-mingw32/sys-root/mingw/bin)
#
#--------------------------------
# Include Modern UI

View file

@ -3,7 +3,12 @@ use strict;
my %deploy;
my $objdump = $ENV{objdump} ? $ENV{objdump} : "objdump";
my @searchdirs;
my @systemdirs = (qr|^c:/windows|i, qr|^c:/winnt|i, qr|^/c/windows|i, qr|^/c/winnt|);
my @systemdirs;
if ($ENV{PATH} =~ "x86_64") {
@systemdirs = (qr|^c:/windows|i, qr|^c:/winnt|i, qr|^/c/windows|i, qr|^/c/winnt|, qr|^/usr/i686|);
} else {
@systemdirs = (qr|^c:/windows|i, qr|^c:/winnt|i, qr|^/c/windows|i, qr|^/c/winnt|);
}
sub addDependenciesFor($) {
open OBJDUMP, "-|", $objdump, "-p", $_[0] or die;

View file

@ -4,10 +4,10 @@ theme.files = $$THEME_FILES
translation.files = $$replace(TRANSLATIONS, .ts, .qm)
exists($$[QT_INSTALL_TRANSLATIONS]) {
qt_translation_dir = $$[QT_INSTALL_TRANSLATIONS]
} else: exists(/usr/share/qt4/translations) {
} else: exists(/usr/share/qt5/translations) {
# On some cross-compilation environments, the translations are either missing or not
# where they're expected to be. In such cases, try copying from the system.
qt_translation_dir = /usr/share/qt4/translations
qt_translation_dir = /usr/share/qt5/translations
}
# Prepend the Qt translation dir so we can actually find the files