[gtk/gtk-2-24] MSVC introspection: Make more robust and avoid confusion



commit 6b55898162bf8d23219aa1e26aadf2a5ebba8293
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jan 18 12:09:56 2019 +0800

    MSVC introspection: Make more robust and avoid confusion
    
    This updates the introspection build process that we also check on
    changes in the Makefiles when we generate the NMake Makefile snippets
    and file lists, so that any changes to the source file list can be
    reflected.  Also ensure that we build against the freshly-built
    libraries.
    
    Make the NMake Makefiles also output the built introspection items to
    the output directories of the various Visual Studio versions, according
    to the build configuration and architecture, so that we avoid confusion
    for different Visual Studio build configs.

 build/Makefile.msvc-introspection      | 14 ++++++++------
 build/win32/gtk-introspection-msvc.mak | 17 +++++++++++------
 gtk/Makefile.am                        |  4 +++-
 3 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/build/Makefile.msvc-introspection b/build/Makefile.msvc-introspection
index 6c9096436f..85c01b4dd9 100644
--- a/build/Makefile.msvc-introspection
+++ b/build/Makefile.msvc-introspection
@@ -79,7 +79,7 @@ $(if $(or $(findstring --header-only,$($(_gir_name)_MSVC_SCANNERFLAGS)),
           $($(_gir_name)_MSVC_PROGRAM)),,
     $(error Need to define $(_gir_name)_MSVC_LIBS or $(_gir_name)_MSVC_PROGRAM))
 
-$(top_builddir)/build/win32/$(_gir_name)_list:
+$(top_builddir)/build/win32/$(_gir_name)_list: Makefile
        for F in $(_gir_files_msvc); do \
                case $$$$F in \
                *.c|*.cpp|*.cc|*.cxx|*.h|*.hpp|*.hh|*.hxx) \
@@ -88,11 +88,11 @@ $(top_builddir)/build/win32/$(_gir_name)_list:
                esac; \
        done
 
-$(top_builddir)/build/win32/$(1).msvc.introspect:
+$(top_builddir)/build/win32/$(1).msvc.introspect: Makefile
        -$(RM) $(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 'vs$$$$(VSVER)\$$$$(CFG)\$$$$(PLAT)\bin\'$(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 '  $$$$(PYTHON) $$$$(G_IR_SCANNER) \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  --verbose -no-libtool   \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
@@ -101,6 +101,7 @@ $(top_builddir)/build/win32/$(1).msvc.introspect:
        echo '  '$(_gir_packages_msvc)' \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  '$(_gir_libraries_msvc)'        \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  '$(_gir_program_msvc)'  \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
+       echo '  --add-include-path=./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin     
\'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  --add-include-path=$$$$(G_IR_INCLUDEDIR)        
\'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  '$(_gir_includes_msvc)' \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  '$(_gir_export_packages_msvc)'  \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
@@ -109,15 +110,16 @@ $(top_builddir)/build/win32/$(1).msvc.introspect:
        echo '  --cflags-end    \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  '$($(_gir_name)_MSVC_SCANNERFLAGS)'     \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  --filelist='$(_gir_name)'_list  \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
+       echo '  -L.\vs$$$$(VSVER)\$$$$(CFG)\$$$$(PLAT)\bin      
\'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  -o $$$$@'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '' >>$(top_builddir)/build/win32/$(1).msvc.introspect
 
 # Finally Assemble the Command to Compile the generated .gir
-       echo '$(_typelib_basename_msvc).typelib: 
'$(_typelib_basename_msvc)'.gir'>>$(top_builddir)/build/win32/$(1).msvc.introspect
+       echo 'vs$$$$(VSVER)\$$$$(CFG)\$$$$(PLAT)\bin\$(_typelib_basename_msvc).typelib: 
vs$$$$(VSVER)\$$$$(CFG)\$$$$(PLAT)\bin\'$(_typelib_basename_msvc)'.gir'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  @-echo Compiling $$$$@...'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  $$$$(G_IR_COMPILER)     \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
-       echo '  --includedir=. --debug --verbose        \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
-       echo '  '$(1)'  \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
+       echo '  --includedir=$$$$(@D:\=/) --debug --verbose     
\'>>$(top_builddir)/build/win32/$(1).msvc.introspect
+       echo '  $$$$(@R:\=/).gir        \'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '  -o $$$$@'>>$(top_builddir)/build/win32/$(1).msvc.introspect
        echo '' >>$(top_builddir)/build/win32/$(1).msvc.introspect
 endef
diff --git a/build/win32/gtk-introspection-msvc.mak b/build/win32/gtk-introspection-msvc.mak
index e711b11b2c..12cc53ceb9 100644
--- a/build/win32/gtk-introspection-msvc.mak
+++ b/build/win32/gtk-introspection-msvc.mak
@@ -6,8 +6,13 @@ APIVERSION = 2.0
 
 CHECK_PACKAGE = gdk-pixbuf-2.0 atk pangocairo gio-2.0
 
-built_install_girs = Gdk-$(APIVERSION).gir Gtk-$(APIVERSION).gir
-built_install_typelibs = Gdk-$(APIVERSION).typelib Gtk-$(APIVERSION).typelib
+built_install_girs =   \
+       vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gdk-$(APIVERSION).gir     \
+       vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gtk-$(APIVERSION).gir
+
+built_install_typelibs =       \
+       vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gdk-$(APIVERSION).typelib \
+       vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gtk-$(APIVERSION).typelib
 
 !include introspection-msvc.mak
 
@@ -30,8 +35,8 @@ setgirbuildenv:
 !include introspection.body.mak
 
 install-introspection: all 
-       @-copy *.gir $(G_IR_INCLUDEDIR)
-       @-copy /b *.typelib $(G_IR_TYPELIBDIR)
+       @-copy vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.gir $(G_IR_INCLUDEDIR)
+       @-copy /b vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.typelib $(G_IR_TYPELIBDIR)
 
 !else
 all:
@@ -39,5 +44,5 @@ all:
 !endif
 
 clean:
-       @-del /f/q *.typelib
-       @-del /f/q *.gir
+       @-del /f/q vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.typelib
+       @-del /f/q vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.gir
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index c6c8db1c53..f53e01c2de 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1007,7 +1007,9 @@ Gtk_2_0_gir_MSVC_EXPORT_PACKAGES = $(Gtk_2_0_gir_EXPORT_PACKAGES)
 Gtk_2_0_gir_MSVC_INCLUDE_GIRS = Atk-1.0
 Gtk_2_0_gir_MSVC_LIBS = gtk-win32-2.0 gdk-win32-2.0
 Gtk_2_0_gir_MSVC_CFLAGS = $(GTK_MSVC_GIR_CFLAGS)
-Gtk_2_0_gir_MSVC_SCANNERFLAGS = --warn-all --add-include-path=. --include-uninstalled=./Gdk-2.0.gir
+Gtk_2_0_gir_MSVC_SCANNERFLAGS =        \
+       --warn-all      \
+       --include-uninstalled='./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin/Gdk-2.0.gir'
 
 include $(top_srcdir)/build/Makefile.msvc-introspection
 


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