diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-05-24 18:50:44 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-07-12 12:44:47 +0000 |
commit | 5337435edaa10518c4495d480f934e87b2ccd444 (patch) | |
tree | 9d4d876f0b9c163721dba1210de008045af6559f /setup.py | |
parent | 8ae4d5827d1ccd463b99aaf54c2e8cb482094c91 (diff) |
Fix Windows module extensions and tests to work with --debug build
Use the same imp.get_suffixes() mechanism as on Unix, to determine
the suffix part of module extension files.
This fixes debug builds to work on Windows.
Note that the whole build stack has to use the same configuration,
no mixing is allowed on Windows.
For release build you need: python.exe + setup.py without --debug
flag + release build of Qt5.
For debug build you need: python_d.exe + setup.py with --debug
flag + debug build of Qt5.
Change-Id: I6188c859b5757d11e87d6a9e32b9ba558f7f609e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 43 |
1 files changed, 29 insertions, 14 deletions
@@ -1067,15 +1067,23 @@ class pyside_build(_build): "{dist_dir}/PySide2/docs/shiboken2", force=False, vars=vars) # <install>/lib/site-packages/shiboken2.pyd -> <setup>/PySide2/shiboken2.pyd + shiboken_module_name = 'shiboken2.pyd' + shiboken_src_path = "{site_packages_dir}".format(**vars) + maybe_shiboken_names = [f for f in os.listdir(shiboken_src_path) + if re.match(r'shiboken.*\.pyd', f)] + if maybe_shiboken_names: + shiboken_module_name = maybe_shiboken_names[0] + vars.update({'shiboken_module_name': shiboken_module_name}) copyfile( - "{site_packages_dir}/shiboken2{dbgPostfix}.pyd", - "{dist_dir}/PySide2/shiboken2{dbgPostfix}.pyd", + "{site_packages_dir}/{shiboken_module_name}", + "{dist_dir}/PySide2/{shiboken_module_name}", vars=vars) if self.debug or self.build_type == 'RelWithDebInfo': - copyfile( - "{build_dir}/shiboken2/shibokenmodule/shiboken2{dbgPostfix}.pdb", - "{dist_dir}/PySide2/shiboken2{dbgPostfix}.pdb", - vars=vars) + copydir( + "{build_dir}/shiboken2/shibokenmodule", + "{dist_dir}/PySide2", + filter=pdbs, + recursive=False, vars=vars) # <install>/lib/site-packages/pyside2uic/* -> <setup>/pyside2uic copydir( "{site_packages_dir}/pyside2uic", @@ -1189,14 +1197,21 @@ class pyside_build(_build): # pdb files for libshiboken and libpyside if self.debug or self.build_type == 'RelWithDebInfo': # XXX dbgPostfix gives problems - the structure in shiboken2/data should be re-written! - copyfile( - "{build_dir}/shiboken2/libshiboken/shiboken2.pdb", - "{dist_dir}/PySide2/shiboken2.pdb", # omitted dbgPostfix - vars=vars) - copyfile( - "{build_dir}/pyside2/libpyside/pyside2.pdb", - "{dist_dir}/PySide2/pyside2.pdb", # omitted dbgPostfix - vars=vars) + # Not sure what the above refers to, but because both the extension module + # (shiboken2.pyd) and the shared library (shiboken2.dll) have the same basename, + # the pdb file gets overwritten. This doesn't happen on Unix because the shared library + # has a 'lib' prefix in the basename. + # @TODO Change the shared library name on Windows. + copydir( + "{build_dir}/shiboken2/libshiboken", + "{dist_dir}/PySide2", + filter=pdbs, + recursive=False, vars=vars) + copydir( + "{build_dir}/pyside2/libpyside", + "{dist_dir}/PySide2", + filter=pdbs, + recursive=False, vars=vars) def update_rpath(self, package_path, executables): if sys.platform.startswith('linux'): |