Further fixes to running the g-ir-* Python scripts on Windows on Python 3.8.x+
Hi,
Due to changes in !443 (merged) and libgirepository
being moved to GLib, the build files need to be updated to do the following:
- If GLib (and thus libffi, as it is a dependency of GObject) is found with pkg-config by setting
-Dpkg_config_path=...
(or--pkg-config-path=...
) rather than usingPKG_CONFIG_PATH
, make sure that this option is honored when building the.gir
files and when running the tests on Windows. This is necessary as the script uses the results of querying the GLib's pkg-config files to find the paths where the GLib DLLs can be found, to feed intoos.add_dll_directory()
on Python 3.8.x or later, so that the scripts can run, as Python-3.8.x or later on Windows only loads DLLs from designated system paths and the paths that were explicitly marked withos.add_dll_directory()
. - Otherwise, if GLib
and/or libffiis built as a subproject, add all of its subdirs(, set an envvarglib
,gobject
,gio
,gmodule
,libffi
, and possibly PCRE, ZLib andproxy-intl
) into an envvarGI_EXTRA_BASE_DLL_DIRS
, that is also used foros.add_dll_directory()
,GLIB_BUILD_DIR
, which will (if not already done so) setPKG_CONFIG_PATH
to look first for the uninstalledgio-2.0-uninstalled.pc
, and then the paths in%PATH%
, so that the freshly-built GLib DLLs and their dependent DLLs can also be loaded.
This will fix building the various introspection files as well as the tests in regards to loading the dependent DLLs for the g-ir-*
script, for G-I.
This will fix #499 (closed) on the gobject-introspection
side.
With blessings, thank you!
Edited by Chun-wei Fan