[gobject-introspection] build/win32: Make detectenv-msvc.mak and introspection-msvc.mak generic



commit b974c39c70ccde44f47084765e843a3b1b777bd8
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Dec 2 15:39:18 2015 +0800

    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.

 build/win32/detectenv-msvc.mak     |   17 +++++++++++------
 build/win32/gi-tests-msvc.mak      |   12 +++++++++++-
 build/win32/introspection-msvc.mak |    8 +++++---
 3 files changed, 27 insertions(+), 10 deletions(-)
---
diff --git a/build/win32/detectenv-msvc.mak b/build/win32/detectenv-msvc.mak
index 2dfb8e1..c23e444 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 caff3fb..b555bcd 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 9862f71..d7cc341 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
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]