[gobject-introspection] MSVC .gir Builds: Allow More Flexibility for Cairo

commit 4e4a414561fdf869dca8a8b554b2d45d876ef14c
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jul 24 12:47:31 2015 +0800

    MSVC .gir Builds: Allow More Flexibility for Cairo
    Allow one to pass in the cairo-gobject DLL filename for generating
    cairo-1.0.gir, as the DLL filename for Cairo-GObject may vary between
    different setups, if needed.  Display a note telling the user that he/she
    needs to ensure that the DLL name used is correct so that programs and
    scripts using the cairo-1.0.typelib can run correctly.
    Also clean up the generation of cairo-1.0.gir a bit by directly generating
    the cairo-1.0.gir in build\ only during the build.

 build/gen-cairo-gir.py          |    2 +-
 build/gi-introspection-msvc.mak |   28 +++++++++++++++++++++-------
 2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/build/gen-cairo-gir.py b/build/gen-cairo-gir.py
index 6963002..2fb365e 100644
--- a/build/gen-cairo-gir.py
+++ b/build/gen-cairo-gir.py
@@ -51,7 +51,7 @@ def main(argv):
     # Set up variables in cairo-1.0.gir.in to produce cairo-1.0.gir
     setup_vars_cairo(os.path.join(preset_gir_path, 'cairo-1.0.gir.in'),
-                     os.path.join(preset_gir_path, 'cairo-1.0.gir'),
+                     'cairo-1.0.gir',
 if __name__ == '__main__':
diff --git a/build/gi-introspection-msvc.mak b/build/gi-introspection-msvc.mak
index d439ef4..2a7a5e3 100644
--- a/build/gi-introspection-msvc.mak
+++ b/build/gi-introspection-msvc.mak
@@ -2,10 +2,12 @@
 # Change or pass in as a variable/env var if needed
 # The main DLLs that are used to build introspection files that are "installed"
 !if "$(USE_LIBTOOL_NAME)" == "1"
-CAIROGOBJECT_DLLNAME = libcairo-gobject-2
+CAIROGOBJECT_DLLNAME = libcairo-gobject-2.dll
-CAIROGOBJECT_DLLNAME = cairo-gobject-vs$(VSVER)
+CAIROGOBJECT_DLLNAME = cairo-gobject-vs$(VSVER).dll
 # Please do not change anything after this line
@@ -48,7 +50,7 @@ built_install_typelibs =      \
-all: setgirbuildnev $(built_install_girs) $(built_install_typelibs) $(bundled_girs) $(bundled_typelibs)
+all: setgirbuildnev $(built_install_girs) $(built_install_typelibs) $(bundled_girs) $(bundled_typelibs) 
 !include gi-setenv-msvc.mak
@@ -132,9 +134,8 @@ GIRepository-$(GLIB_APIVERSION).gir: gi_list GObject-$(GLIB_APIVERSION).gir
 # Bundled cairo-1.0.gir.in processing
 cairo-1.0.gir: ..\gir\cairo-1.0.gir.in
-       @-echo Generating and copying $@ from $*.gir.in...
-       @-if not exist ..\gir\$*.gir $(PYTHON2) gen-cairo-gir.py --dllname=$(CAIROGOBJECT_DLLNAME).dll
-       @-copy ..\gir\$*.gir $@
+       @-echo Generating $@ from $*.gir.in...
+       @-$(PYTHON2) gen-cairo-gir.py --dllname=$(CAIROGOBJECT_DLLNAME)
 # Copy the .gir's bundled with G-I to this folder
 $(bundled_girs): ..\gir\win32-1.0.gir ..\gir\fontconfig-2.0.gir ..\gir\freetype2-2.0.gir ..\gir\GL-1.0.gir 
@@ -151,6 +152,20 @@ $(bundled_typelibs): cairo-1.0.gir $(bundled_girs)
        @-echo Compiling the bundled $*.gir that came with the GobjectIntrospection package...
        @-$(G_IR_COMPILER_CURRENT) --includedir=. --debug --verbose $*.gir -o $@
+       @-echo.
+       @-echo ************* Note ***********************************
+       @-echo The cairo-1.0.gir links to $(CAIROGOBJECT_DLLNAME),
+       @-echo please ensure that this is the correct DLL where the
+       @-echo cairo-gobject symbols can be loaded, which needs to
+       @-echo be in your PATH when running programs or scripts
+       @-echo using cairo-1.0.typelib.
+       @-echo.
+       @-echo If not, please clean the build and redo the build
+       @-echo specifying the correct DLL by passing in
+       @-echo CAIROGOBJECT_DLLNAME^=^<your DLL full filename^> when
+       @-echo invoking this NMake Makefile
 install-introspection: setgirbuildnev $(built_install_girs) $(built_install_typelibs) $(bundled_girs) 
cairo-1.0.gir $(bundled_typelibs)
        @-mkdir $(G_IR_INCLUDEDIR)
        @-mkdir $(G_IR_TYPELIBDIR)
@@ -168,7 +183,6 @@ install-introspection:
-       @-del /f/q ..\gir\cairo-$(GI_APIVERSION).gir
        @-del /f/q *.typelib
        @-del /f/q *.gir
        @-del /f/q gi_list

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