From d31fe6a73cf29df1e7bf0edd76c30aa124bb0328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Mon, 15 Jul 2013 20:04:19 +0200 Subject: Fixed Qt5 compilation on Windows. Change-Id: I2d4de311e7d8c6909f6a35dbb650380e2b0b1da9 diff --git a/BuildTools/SCons/Tools/WindowsBundle.py b/BuildTools/SCons/Tools/WindowsBundle.py index c3c77aa..2c0b3a4 100644 --- a/BuildTools/SCons/Tools/WindowsBundle.py +++ b/BuildTools/SCons/Tools/WindowsBundle.py @@ -1,12 +1,15 @@ import SCons.Util, os def generate(env) : - def createWindowsBundle(env, bundle, resources = {}, qtimageformats = [], qtlibs = []) : + def createWindowsBundle(env, bundle, resources = {}, qtimageformats = [], qtlibs = [], qtversion = '4') : all_files = [] all_files += env.Install(bundle, bundle + ".exe") for lib in qtlibs : all_files += env.Install(bundle, os.path.join(env["QTDIR"], "bin", lib + ".dll")) - all_files += env.Install(os.path.join(bundle, "imageformats"), [os.path.join(env["QTDIR"], "plugins", "imageformats", "q" + codec + "4.dll") for codec in qtimageformats]) + imageformats_suffix = '4' + if qtversion == '5' : + imageformats_suffix = '' + all_files += env.Install(os.path.join(bundle, "imageformats"), [os.path.join(env["QTDIR"], "plugins", "imageformats", "q" + codec + imageformats_suffix + ".dll") for codec in qtimageformats]) for dir, resourceFiles in resources.items() : for resource in resourceFiles : diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py index 8e174c0..02701e7 100644 --- a/BuildTools/SCons/Tools/qt4.py +++ b/BuildTools/SCons/Tools/qt4.py @@ -479,13 +479,17 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4' self.AppendUnique(CPPPATH=[os.path.join("$QTDIR","include","QtAssistant")]) modules.remove("QtAssistant") modules.append("QtAssistantClient") - # FIXME: Phonon Hack if version == '4' : + # FIXME: Phonon Hack self.AppendUnique(LIBS=['phonon'+debugSuffix+version]) - self.AppendUnique(LIBS=[lib+debugSuffix+version for lib in modules if lib not in staticModules]) + self.AppendUnique(LIBS=[lib+debugSuffix+version for lib in modules if lib not in staticModules]) + else : + self.AppendUnique(LIBS=[lib.replace('Qt', 'Qt5') + debugSuffix for lib in modules if lib not in staticModules]) self.PrependUnique(LIBS=[lib+debugSuffix for lib in modules if lib in staticModules]) if 'QtOpenGL' in modules: self.AppendUnique(LIBS=['opengl32']) + elif version == '5' : + self.Append(CPPDEFINES = ["QT_NO_OPENGL"]) self.AppendUnique(CPPPATH=[ '$QTDIR/include/']) self.AppendUnique(CPPPATH=[ '$QTDIR/include/'+module for module in modules]) if crosscompiling : diff --git a/Swift/QtUI/QtWin32NotifierWindow.h b/Swift/QtUI/QtWin32NotifierWindow.h index b8d9c77..cd43cf2 100644 --- a/Swift/QtUI/QtWin32NotifierWindow.h +++ b/Swift/QtUI/QtWin32NotifierWindow.h @@ -23,7 +23,7 @@ namespace Swift { } virtual HWND getID() const { - return winId(); + return (HWND) winId(); } }; } diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index d71375d..ae674f3 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -359,7 +359,7 @@ if env.get("SWIFT_INSTALLDIR", "") : env.Install(os.path.join(env["SWIFT_INSTALLDIR"], "share", "swift", dir), resource) if env["PLATFORM"] == "win32" : - if env["DIST"] : + if env["DIST"] or ARGUMENTS.get("dump_trace") : commonResources[""] = commonResources.get("", []) + [ #os.path.join(env["OPENSSL_DIR"], "bin", "ssleay32.dll"), #os.path.join(env["OPENSSL_DIR"], "bin", "libeay32.dll"), @@ -368,12 +368,21 @@ if env["PLATFORM"] == "win32" : if env["SWIFTEN_DLL"] : commonResources[""] = commonResources.get("", []) + ["#/Swiften/${SWIFTEN_LIBRARY_FILE}"] qtimageformats = ["gif", "ico", "jpeg", "mng", "svg", "tiff"] - qtlibs = ["QtCore4", "QtGui4", "QtNetwork4", "QtWebKit4", "QtXMLPatterns4", "phonon4"] + qtlibs = ["QtCore", "QtGui", "QtNetwork", "QtWebKit", "QtXMLPatterns"] + if qt_version == '4' : + qtlibs.append("phonon") + qtlibs = [lib + '4' for lib in qtlibs] + else : + qtlibs += ['QtQuick', 'QtQml', 'QtV8', 'QtMultimedia', 'QtSql', 'QtSensors', 'QtWidgets', 'QtWebKitWidgets', 'QtMultimediaWidgets', 'QtOpenGL', 'QtPrintSupport'] + qtlibs = [lib.replace('Qt', 'Qt5') for lib in qtlibs] + qtlibs += ['icuin51', 'icuuc51', 'icudt51', 'libGLESv2', 'libEGL'] windowsBundleFiles = myenv.WindowsBundle("Swift", resources = commonResources, qtimageformats = qtimageformats, - qtlibs = qtlibs) + qtlibs = qtlibs, + qtversion = qt_version) + if env["DIST"] : #myenv.Append(NSIS_OPTIONS = [ # "/DmsvccRedistributableDir=\"" + env["vcredist"] + "\"", # "/DbuildVersion=" + myenv["SWIFT_VERSION"] diff --git a/Swift/QtUI/WinUIHelpers.cpp b/Swift/QtUI/WinUIHelpers.cpp index 3942ac1..161ff1d 100644 --- a/Swift/QtUI/WinUIHelpers.cpp +++ b/Swift/QtUI/WinUIHelpers.cpp @@ -47,7 +47,7 @@ void WinUIHelpers::displayCertificateChainAsSheet(QWidget* parent, const std::ve CRYPTUI_VIEWCERTIFICATE_STRUCT viewDialogProperties = { 0 }; viewDialogProperties.dwSize = sizeof(viewDialogProperties); - viewDialogProperties.hwndParent = parent->winId(); + viewDialogProperties.hwndParent = (HWND) parent->winId(); viewDialogProperties.dwFlags = CRYPTUI_DISABLE_EDITPROPERTIES | CRYPTUI_DISABLE_ADDTOSTORE | CRYPTUI_ENABLE_REVOCATION_CHECKING; viewDialogProperties.pCertContext = certificate_chain.get(); viewDialogProperties.cStores = 1; -- cgit v0.10.2-6-g49f6