[gtk/gtk-3-24] MSVC builds: Improve introspection build process



commit 5ffbeeff919cdf401ae4d0fc9925ae5393f73b38
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Jan 17 18:16:44 2019 +0800

    MSVC builds: Improve introspection build process
    
    To avoid confusion, have the NMake Makefiles output the built introspection
    files in the same location where the binaries are built for the project
    files, according to the Visual Studio version, platform and configuration
    where the build is carried out.
    
    Also make generating the introspection NMake snippet portion more robust to
    source additions and removals by checking on Makefile changes too.

 build/Makefile.msvc-introspection      | 13 +++++++------
 build/win32/gtk-introspection-msvc.mak | 19 +++++++++++++------
 gdk/Makefile.am                        |  2 +-
 gtk/Makefile.am                        |  2 +-
 4 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/build/Makefile.msvc-introspection b/build/Makefile.msvc-introspection
index 16cf7dda31..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
@@ -114,11 +115,11 @@ $(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 6c44b64323..aee0dfccbe 100644
--- a/build/win32/gtk-introspection-msvc.mak
+++ b/build/win32/gtk-introspection-msvc.mak
@@ -6,8 +6,15 @@ APIVERSION = 3.0
 
 CHECK_PACKAGE = gdk-pixbuf-2.0 atk pangocairo gio-2.0
 
-built_install_girs = Gdk-$(APIVERSION).gir GdkWin32-$(APIVERSION).gir Gtk-$(APIVERSION).gir
-built_install_typelibs = Gdk-$(APIVERSION).typelib GdkWin32-$(APIVERSION).typelib Gtk-$(APIVERSION).typelib
+built_install_girs =   \
+       vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gdk-$(APIVERSION).gir     \
+       vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(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\GdkWin32-$(APIVERSION).typelib    \
+       vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gtk-$(APIVERSION).typelib
 
 !include introspection-msvc.mak
 
@@ -30,8 +37,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 +46,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/gdk/Makefile.am b/gdk/Makefile.am
index 9550187a8b..e25b57ba50 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -534,7 +534,7 @@ GdkWin32_3_0_gir_MSVC_CFLAGS = $(BASE_MSVC_GIR_CFLAGS)
 GdkWin32_3_0_gir_MSVC_SCANNERFLAGS =   \
        --identifier-prefix=Gdk         \
        --c-include="gdk/gdkwin32.h"    \
-       --include-uninstalled=./Gdk-3.0.gir
+       --include-uninstalled='./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin/Gdk-3.0.gir'
 
 include $(top_srcdir)/build/Makefile.msvc-introspection
 
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 559442963e..4a21c7bb2e 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1551,7 +1551,7 @@ Gtk_3_0_gir_MSVC_EXPORT_PACKAGES = $(Gtk_3_0_gir_EXPORT_PACKAGES)
 Gtk_3_0_gir_MSVC_INCLUDE_GIRS = Atk-1.0
 Gtk_3_0_gir_MSVC_LIBS = gtk-3.0 gdk-3.0
 Gtk_3_0_gir_MSVC_CFLAGS = $(GTK_MSVC_GIR_CFLAGS)
-Gtk_3_0_gir_MSVC_SCANNERFLAGS = --warn-all --add-include-path=. --include-uninstalled=./Gdk-3.0.gir
+Gtk_3_0_gir_MSVC_SCANNERFLAGS = --warn-all 
--include-uninstalled='./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin/Gdk-3.0.gir'
 
 include $(top_srcdir)/build/Makefile.msvc-introspection
 


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