mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Visual Studio builds: Add script to generate utility scripts
This will allow the utility scripts glib-mkenums and gdbus-codegen be generated with the proper info in them, as build systems such as Meson might look for shebang lines to determine the commands that need to be called to invoke the scripts (which is necessary for calling these scripts on standard Windows cmd.exe)
This commit is contained in:
parent
a05b64a0cb
commit
c5cd5bcd97
@ -3,4 +3,5 @@ SUBDIRS = vs9 vs10 vs11 vs12 vs14 vs15
|
||||
EXTRA_DIST = \
|
||||
glibpc.py \
|
||||
pc_base.py \
|
||||
replace.py
|
||||
replace.py \
|
||||
gen_util_scripts.py
|
||||
|
32
win32/gen_util_scripts.py
Normal file
32
win32/gen_util_scripts.py
Normal file
@ -0,0 +1,32 @@
|
||||
# Simple Python script to generate the full .schema.xml files
|
||||
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
from replace import replace_multi
|
||||
|
||||
def main(argv):
|
||||
parser = argparse.ArgumentParser(description='Generate Utility Scripts')
|
||||
parser.add_argument('-t', '--type', help='Script Type (glib-mkenums or gdbus-codegen)', required=True)
|
||||
parser.add_argument('--version', help='Package Version', required=True)
|
||||
args = parser.parse_args()
|
||||
|
||||
replace_items = {'@PYTHON@': 'python',
|
||||
'@PERL_PATH@': 'perl',
|
||||
'@GLIB_VERSION@': args.version}
|
||||
|
||||
if args.type == 'glib-mkenums':
|
||||
replace_multi('../gobject/glib-mkenums.in',
|
||||
'../gobject/glib-mkenums',
|
||||
replace_items)
|
||||
elif args.type == 'gdbus-codegen':
|
||||
replace_multi('../gio/gdbus-2.0/codegen/gdbus-codegen.in',
|
||||
'../gio/gdbus-2.0/codegen/gdbus-codegen',
|
||||
replace_items)
|
||||
|
||||
else:
|
||||
raise ValueError('Type must be glib-mkenums or gdbus-codegen')
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv))
|
Loading…
Reference in New Issue
Block a user