summaryrefslogtreecommitdiff
path: root/win32/gen-win32-cairo-gir.py
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2017-01-09 15:09:53 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2017-01-09 17:30:44 +0800
commit4bcad96c5a3f1ab17187e264e0e550fab56a29dc (patch)
treec8b60c5178121739df29c0507482170a5764db89 /win32/gen-win32-cairo-gir.py
parent46b6521c246948182d5ac19e2c5c5a719f1e3825 (diff)
downloadgobject-introspection-4bcad96c5a3f1ab17187e264e0e550fab56a29dc.tar.gz
Visual Studio builds: Move build files to win32/
As suggested, we don't really need two layers of directories to get to the projects, so move the project files to be under win32/ rather than build/win32/.
Diffstat (limited to 'win32/gen-win32-cairo-gir.py')
-rw-r--r--win32/gen-win32-cairo-gir.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/win32/gen-win32-cairo-gir.py b/win32/gen-win32-cairo-gir.py
new file mode 100644
index 00000000..f26031b3
--- /dev/null
+++ b/win32/gen-win32-cairo-gir.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+#
+# Expand the bundled cairo-1.0.gir.in files
+# for use in Visual C++ builds of G-I
+#
+# Author: Fan, Chun-wei
+# Date: January 20, 2014
+#
+# (Adapted from setup.py in
+# $(glib_src_root)/build/win32/setup.py written by Shixin Zeng)
+
+import os
+import sys
+import argparse
+
+import replace
+
+from gi_msvc_build_utils import parent_dir
+
+def main(argv):
+ parser = argparse.ArgumentParser(description='Generate the complete cairo-1.0.gir')
+ parser.add_argument('--dllname',
+ required=True,
+ help='Full file name of the Cairo-GObject DLL for the Cairo Introspection File')
+ args = parser.parse_args()
+
+ # Get the srcroot and the path where the bundled .gir files reside in the package
+ srcroot = parent_dir(__file__)
+ preset_gir_path = os.path.join(srcroot, 'gir')
+
+ # Set up variables in cairo-1.0.gir.in to produce cairo-1.0.gir
+ cairo_replace_items = {'%CAIRO_GIR_PACKAGE%': 'cairo-gobject',
+ '%CAIRO_SHARED_LIBRARY%': args.dllname}
+ replace.replace_multi(os.path.join(preset_gir_path, 'cairo-1.0.gir.in'),
+ 'cairo-1.0.gir',
+ cairo_replace_items)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))