diff options
Diffstat (limited to 'BuildTools/SCons/Tools/WindowsBundle.py')
| -rw-r--r-- | BuildTools/SCons/Tools/WindowsBundle.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/BuildTools/SCons/Tools/WindowsBundle.py b/BuildTools/SCons/Tools/WindowsBundle.py index 20d41ff..4d73fa3 100644 --- a/BuildTools/SCons/Tools/WindowsBundle.py +++ b/BuildTools/SCons/Tools/WindowsBundle.py @@ -27,19 +27,19 @@ def generate(env) : p = subprocess.Popen(['windeployqt', '--release', '--dry-run', '--list', 'mapping', 'Swift.exe'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=environ) else: p = subprocess.Popen(['windeployqt', '--debug', '--dry-run', '--list', 'mapping', 'Swift.exe'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=environ) if p: stdout, stderr = p.communicate() mappings = [] - p = re.compile(ur'"([^\"]*)" "([^\"]*)"') + p = re.compile(r'"([^\"]*)" "([^\"]*)"') matches = re.findall(p, stdout) for match in matches: mappings.append(match) return mappings else: return False def createWindowsBundleManual(env, bundle, resources = {}, qtplugins = {}, qtlibs = [], qtversion = '4') : @@ -77,34 +77,47 @@ def generate(env) : if e.isdir() : for subresource in env.Glob(str(e) + "/*") : all_files += env.Install(os.path.join(bundle, dir, e.name), subresource) else : all_files += env.Install(os.path.join(bundle, dir), resource) qtmappings = captureWinDeployQtMapping() assert(qtmappings) + # Add QtWebKit dependencies. + # This is needed as QtWebKit since 5.6 is developed and released seperately + # of Qt and windeployqt does not know about its dependencies anymore. + for map_from, map_to in qtmappings: + if map_to == "Qt5WebKit.dll": + # hidden Qt5WebKit dependencies + hidden_dependencies = ["libxml2.dll", "libxslt.dll"] + for dependency in hidden_dependencies: + dependency_from_path = os.path.join(env["QTDIR"], "bin", dependency) + if os.path.isfile(dependency_from_path): + qtmappings.append((dependency_from_path, dependency)) + break + # handle core DLLs - qt_corelib_regex = re.compile(ur".*bin.*\\(.*)\.dll") + qt_corelib_regex = re.compile(r".*bin.*\\(.*)\.dll") for qtlib in qtlibs: if qtlib.startswith("Qt5"): (src_path, target_path) = next(((src_path, target_path) for (src_path, target_path) in qtmappings if qt_corelib_regex.match(src_path) and qt_corelib_regex.match(src_path).group(1) == qtlib), (None, None)) if src_path != None: all_files += env.Install(bundle, src_path) # handle core dependencies for (src_path, target_path) in qtmappings: if qt_corelib_regex.match(src_path) and not qt_corelib_regex.match(src_path).group(1).startswith("Qt5"): all_files += env.Install(bundle, src_path) # handle plugins - qt_plugin_regex = re.compile(ur".*plugins.*\\(.*)\\(.*)\.dll") + qt_plugin_regex = re.compile(r".*plugins.*\\(.*)\\(.*)\.dll") for (src_path, target_path) in qtmappings: if qt_plugin_regex.match(src_path): plugin_folder, filename = qt_plugin_regex.match(src_path).groups() try: if plugin_folder in ["audio"] or filename[1:] in qtplugins[plugin_folder]: all_files += env.Install(os.path.join(bundle, plugin_folder), src_path) except: pass return all_files @@ -113,10 +126,9 @@ def generate(env) : if which("windeployqt.exe"): return createWindowsBundleWithWinDeployQt(env, bundle, resources, qtplugins, qtlibs, qtversion) else: return createWindowsBundleManual(env, bundle, resources, qtplugins, qtlibs, qtversion) env.AddMethod(createWindowsBundle, "WindowsBundle") def exists(env) : return env["PLATFORM"] == "win32" - |
Swift