summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2016-04-11 14:47:39 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2016-04-12 18:13:19 +0800
commit8af555a8b621d6396894a759d8e413e92a47c7ea (patch)
tree61022336fbe79d70e4eb1d1128b14822a01bdbfc
parentd2c8d8ea4a6be5b9074cd46186c72ccbf7c185c8 (diff)
downloadlibsoup-8af555a8b621d6396894a759d8e413e92a47c7ea.tar.gz
MSVC builds: Sync introspection items with the latest items from G-I
This updates the NMake items for introspection to be like what is now in G-I's build/win32, so that things are more consistent here.
-rw-r--r--build/win32/detectenv-msvc.mak17
-rw-r--r--build/win32/introspection-msvc.mak47
-rw-r--r--build/win32/soup-introspection-msvc.mak6
3 files changed, 51 insertions, 19 deletions
diff --git a/build/win32/detectenv-msvc.mak b/build/win32/detectenv-msvc.mak
index 7a29ba4a..61f979d4 100644
--- a/build/win32/detectenv-msvc.mak
+++ b/build/win32/detectenv-msvc.mak
@@ -1,3 +1,8 @@
+# Common NMake Makefile module for checking the build environment
+# This can be copied from $(glib_srcroot)\build\win32 for GNOME items
+# that support MSVC builds and introspection under MSVC, and can be used
+# for building test programs as well.
+
# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or
# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir)
!if !defined(VCINSTALLDIR) && !defined(WINDOWSSDKDIR)
@@ -50,14 +55,18 @@ version is not supported.
!endif
VALID_CFGSET = FALSE
-!if "$(CFG)" == "release" || "$(CFG)" == "debug"
+!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug"
VALID_CFGSET = TRUE
!endif
-!if "$(CFG)" == "release"
-CFLAGS_ADD = /MD /O2
+# We want debugging symbols logged for all builds,
+# using .pdb files for release builds
+CFLAGS_BASE = /Zi
+
+!if "$(CFG)" == "release" || "$(CFG)" == "Release"
+CFLAGS_ADD = /MD /O2 $(CFLAGS_BASE)
!else
-CFLAGS_ADD = /MDd /Od /Zi
+CFLAGS_ADD = /MDd /Od $(CFLAGS_BASE)
!endif
!if "$(PLAT)" == "x64"
diff --git a/build/win32/introspection-msvc.mak b/build/win32/introspection-msvc.mak
index 121b7fdb..87398442 100644
--- a/build/win32/introspection-msvc.mak
+++ b/build/win32/introspection-msvc.mak
@@ -1,17 +1,34 @@
-# Common Utility NMake Makefile Template
-# Used to Generate Introspection files for various Projects
+# Common NMake Makefile module for checking the build environment is sane
+# for building introspection files under MSVC/NMake.
+# This can be copied from $(gi_srcroot)\build\win32 for GNOME items
+# that support MSVC builds and introspection under MSVC.
-# Can Override with env vars as needed
+# Can override with env vars as needed
# You will need to have built gobject-introspection for this to work.
# Change or pass in or set the following to suit your environment
-!if "$(BASEDIR)" == ""
-BASEDIR = ..\..\..\vs$(VSVER)\$(PLAT)
+!if "$(PREFIX)" == ""
+PREFIX = ..\..\..\vs$(VSVER)\$(PLAT)
+!endif
+
+!if ![setlocal] && \
+ ![set PFX=$(PREFIX)] && \
+ ![for %P in (%PFX%) do @echo PREFIX_FULL=%~dpnfP > pfx.x]
+!endif
+!include pfx.x
+
+!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
# the GObject-introspection scanner Python module!
-# Either having python.exe your PATH will work or passing in
+# Either having python.exe your PATH will work or passing in
# PYTHON=<full path to your Python interpretor> will do
# This is required, and gobject-introspection needs to be built
@@ -20,14 +37,19 @@ BASEDIR = ..\..\..\vs$(VSVER)\$(PLAT)
PYTHON=python
!endif
+# Path to the pkg-config tool, if not already in the PATH
+!if "$(PKG_CONFIG)" == ""
+PKG_CONFIG=pkg-config
+!endif
+
# Don't change anything following this line!
GIR_SUBDIR = share\gir-1.0
GIR_TYPELIBDIR = lib\girepository-1.0
-G_IR_SCANNER = $(BASEDIR)\bin\g-ir-scanner
-G_IR_COMPILER = $(BASEDIR)\bin\g-ir-compiler.exe
-G_IR_INCLUDEDIR = $(BASEDIR)\$(GIR_SUBDIR)
-G_IR_TYPELIBDIR = $(BASEDIR)\$(GIR_TYPELIBDIR)
+G_IR_SCANNER = $(PREFIX)\bin\g-ir-scanner
+G_IR_COMPILER = $(PREFIX)\bin\g-ir-compiler.exe
+G_IR_INCLUDEDIR = $(PREFIX)\$(GIR_SUBDIR)
+G_IR_TYPELIBDIR = $(PREFIX)\$(GIR_TYPELIBDIR)
VALID_PKG_CONFIG_PATH = FALSE
@@ -38,7 +60,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] \
@@ -56,7 +79,7 @@ VALID_PKG_CONFIG_PATH = FALSE
!endif
VALID_CFGSET = FALSE
-!if "$(CFG)" == "release" || "$(CFG)" == "debug"
+!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug"
VALID_CFGSET = TRUE
!endif
diff --git a/build/win32/soup-introspection-msvc.mak b/build/win32/soup-introspection-msvc.mak
index d2fa8f20..e1bbeb1c 100644
--- a/build/win32/soup-introspection-msvc.mak
+++ b/build/win32/soup-introspection-msvc.mak
@@ -21,10 +21,10 @@ install-introspection: all
@-copy /b SoupGNOME-$(APIVERSION).typelib $(G_IR_TYPELIBDIR)
setbuildenv:
- @set PYTHONPATH=$(BASEDIR)\lib\gobject-introspection
- @set PATH=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(BASEDIR)\bin;$(PATH)
+ @set PYTHONPATH=$(PREFIX)\lib\gobject-introspection
+ @set PATH=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(PREFIX)\bin;$(PATH)
@set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
- @set LIB=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(BASEDIR)\lib;$(LIB)
+ @set LIB=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(PREFIX)\lib;$(LIB)
!include introspection.body.mak