summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2015-12-02 15:39:18 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2015-12-02 21:20:52 +0800
commitb974c39c70ccde44f47084765e843a3b1b777bd8 (patch)
treea52da8e658b3d6d41b939f09587ac267f5b07b0d
parent3163145110b766b6fcf372b40e9ad3cce45adff0 (diff)
downloadgobject-introspection-b974c39c70ccde44f47084765e843a3b1b777bd8.tar.gz
build/win32: Make detectenv-msvc.mak and introspection-msvc.mak generic
We want to have projects to share common items as much as possible, so move project-specific away from detectenv-msvc.mak and introspection-msvc.mak so that projects needing to update intropsection-msvc.mak can come back here to update it, and update detectenv-msvc.mak from $(glib_srcroot)/build/win32.
-rw-r--r--build/win32/detectenv-msvc.mak17
-rw-r--r--build/win32/gi-tests-msvc.mak12
-rw-r--r--build/win32/introspection-msvc.mak8
3 files changed, 27 insertions, 10 deletions
diff --git a/build/win32/detectenv-msvc.mak b/build/win32/detectenv-msvc.mak
index 2dfb8e18..c23e444f 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)
@@ -54,14 +59,14 @@ VALID_CFGSET = FALSE
VALID_CFGSET = TRUE
!endif
+# We want debugging symbols logged for all builds,
+# using .pdb files for release builds
+CFLAGS_BASE = /Zi
+
!if "$(CFG)" == "release"
-!if "$(VSVER)" == "9" && "$(PLAT)" == "x64"
-CFLAGS_ADD = /MD /O1 /Oi
-!else
-CFLAGS_ADD = /MD /O2
-!endif
+CFLAGS_ADD = /MD /O2 $(CFLAGS_BASE)
!else
-CFLAGS_ADD = /MDd /Od /Zi /DG_ENABLE_DEBUG
+CFLAGS_ADD = /MDd /Od $(CFLAGS_BASE)
!endif
!if "$(PLAT)" == "x64"
diff --git a/build/win32/gi-tests-msvc.mak b/build/win32/gi-tests-msvc.mak
index caff3fb9..b555bcdf 100644
--- a/build/win32/gi-tests-msvc.mak
+++ b/build/win32/gi-tests-msvc.mak
@@ -4,8 +4,18 @@
!include gi-build-common-msvc.mak
+!if "$(CFG)" == "release"
+!if "$(VSVER)" == "9" && "$(PLAT)" == "x64"
+TESTS_CFLAGS_ADD = /MD /O1 /Oi
+!else
+TESTS_CFLAGS_ADD = $(CFLAGS_ADD)
+!endif
+!else
+TESTS_CFLAGS_ADD = /MDd /Od /Zi /DG_ENABLE_DEBUG
+!endif
+
BASE_GLIB_LIBS = gio-$(GLIB_APIVERSION).lib gobject-$(GLIB_APIVERSION).lib gmodule-$(GLIB_APIVERSION).lib glib-$(GLIB_APIVERSION).lib
-CFLAGS = $(CFLAGS_ADD) /I$(TOP_SRCDIR) /W3 /we4013 /FImsvc_recommended_pragmas.h /DHAVE_CONFIG_H
+CFLAGS = $(TESTS_CFLAGS_ADD) /I$(TOP_SRCDIR) /W3 /we4013 /FImsvc_recommended_pragmas.h /DHAVE_CONFIG_H
LDFLAGS = /link $(LDFLAGS_ARCH) $(BASE_GLIB_LIBS)
LDFLAGS_DLL = /link $(LDFLAGS_ARCH) /DLL /out:$@ /implib:$*-$(GI_APIVERSION).lib $(BASE_GLIB_LIBS)
diff --git a/build/win32/introspection-msvc.mak b/build/win32/introspection-msvc.mak
index 9862f715..d7cc3419 100644
--- a/build/win32/introspection-msvc.mak
+++ b/build/win32/introspection-msvc.mak
@@ -1,7 +1,9 @@
-# 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