From e75eef346bf5fc0644d98b7d5d8a20229d125eb6 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 11 Mar 2016 11:48:14 +0800 Subject: MSVC builds: Make introspection builds a bit easier GLib recently had a script that would generate the pkg-config files for its Visual Studio builds, which would be sufficient for the need of building introspection files, so update the NMake Makefile modules to look for them automatically, without the need to manually set PKG_CONFIG_PATH in the console, provided that the build was done in the same directory tree[1] and was not moved. Note that this would precede any PKG_CONFIG_PATH's that were already set in the console. [1]: This would mean: $(tree_root) | |--$(GLib_src_tree) |--$(G-I_src_tree) |... --- build/win32/introspection-msvc.mak | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build/win32/introspection-msvc.mak b/build/win32/introspection-msvc.mak index d32f7cf5..fe4fa679 100644 --- a/build/win32/introspection-msvc.mak +++ b/build/win32/introspection-msvc.mak @@ -9,6 +9,20 @@ !if "$(PREFIX)" == "" PREFIX = ..\..\..\vs$(VSVER)\$(PLAT) +!if ![setlocal] && \ + ![set PFX=$(PREFIX)] && \ + ![for %P in (%PFX%) do @echo PREFIX_FULL=%~dpnfP > pfx.x] +!endif +!include pfx.x +!endif + +!if "$(PKG_CONFIG_PATH)" == "" +PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig +!else +PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig;$(PKG_CONFIG_PATH) +!endif + +!if ![del $(ERRNUL) /q/f pfx.x] !endif # Note: The PYTHON must be the Python release series that was used to build @@ -40,7 +54,8 @@ ERROR_MSG = BUILD_INTROSPECTION = TRUE -!if ![pkg-config --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x] \ +!if ![set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)] \ + && ![pkg-config --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x] \ && ![setlocal] \ && ![set file="pkgconfig.x"] \ && ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize] \ -- cgit v1.2.1