[gsettings-desktop-schemas] MSVC builds: Sync with G-I NMake Makefiles for introspection



commit d938c4b49cb9cfdc5f15ac1f7f37b422220aa36f
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Apr 11 15:12:45 2016 +0800

    MSVC builds: Sync with G-I NMake Makefiles for introspection
    
    This makes things in line with the NMake Makefiles in G-I, which makes the
    introspection builds a bit more flexible.  Also, since Python 3.x is now
    supported, remove mentions in the NMake Makefiles that only 2.x is supported
    for introspection.

 build/Makefile.msvc-introspection                 |    2 +-
 build/win32/detectenv-msvc.mak                    |   20 +++++--
 build/win32/gsettings-desktop-schemas-msvc.mak.in |    4 -
 build/win32/introspection-msvc.mak                |   62 +++++++++++++++------
 4 files changed, 60 insertions(+), 28 deletions(-)
---
diff --git a/build/Makefile.msvc-introspection b/build/Makefile.msvc-introspection
index 9c3a14a..6c90964 100644
--- a/build/Makefile.msvc-introspection
+++ b/build/Makefile.msvc-introspection
@@ -94,7 +94,7 @@ $(top_builddir)/build/win32/$(1).msvc.introspect:
 # Assemble the Command to Run g-ir-scanner
        echo $(1)': '$(_gir_name)'_list 
'$($(_gir_name)_MSVC_GIR_DEPS)>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  @-echo Generating $$$$    '>>$(top_builddir)/build/win32/$(1).msvc.introspect
-       echo '  $$$$(PYTHON2) $$$$(G_IR_SCANNER)        \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
+       echo '  $$$$(PYTHON) $$$$(G_IR_SCANNER) \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  --verbose -no-libtool   \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  --namespace='$(_gir_namespace_msvc)'    \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  --nsversion='$(_gir_version_msvc)'      \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
diff --git a/build/win32/detectenv-msvc.mak b/build/win32/detectenv-msvc.mak
index 975e11d..61f979d 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)
@@ -45,20 +50,23 @@ VSVER = 0
 MSG = ^
 This NMake Makefile set supports Visual Studio^
 9 (2008) through 14 (2015).  Your Visual Studio^
-version is not supported.  Note that there is no^
-Visual Studio 13.
+version is not supported.
 !error $(MSG)
 !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/gsettings-desktop-schemas-msvc.mak.in 
b/build/win32/gsettings-desktop-schemas-msvc.mak.in
index b255ed2..adb6517 100644
--- a/build/win32/gsettings-desktop-schemas-msvc.mak.in
+++ b/build/win32/gsettings-desktop-schemas-msvc.mak.in
@@ -8,15 +8,11 @@ CHECK_PACKAGE=gio-2.0
 
 # Python.exe either needs to be in your PATH or you need to pass
 # in PYTHON=<full-path-to-your-Python-executable> for this to work
-# Python 3.x can be used unless introspection files are to be built,
-# where only Python 2.7.x is supported
 
 !IF "$(PYTHON)" == ""
 PYTHON=python
 !ENDIF
 
-PYTHON2=$(PYTHON)
-
 # Prefix of your installation.  Pass in PREFIX=<your-installation-prefix>
 # if needed.  glib-compile-schemas.exe and glib-mkenums need to be found
 # in $(PREFIX)\bin
diff --git a/build/win32/introspection-msvc.mak b/build/win32/introspection-msvc.mak
index ca6813e..8739844 100644
--- a/build/win32/introspection-msvc.mak
+++ b/build/win32/introspection-msvc.mak
@@ -1,29 +1,56 @@
-# 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
 
-BASEDIR = $(PREFIX)
-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)
+!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
 
-# Note: The PYTHON2 must be a Python 2.6.x or 2.7.x Interpretor!
-# Either having python.exe from Python 2.6.x/2.7.x in your PATH will work
-# or passing in PYTHON2=<full path to your Python 2.6.x/2.7.x interpretor> will do
+!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
+# PYTHON=<full path to your Python interpretor> will do
 
 # This is required, and gobject-introspection needs to be built
 # before this can be successfully run.
-!if "$(PYTHON2)" == ""
-PYTHON2=python
+!if "$(PYTHON)" == ""
+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 = $(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
 
 MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
@@ -33,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]       \
@@ -51,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
 


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