diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-25 11:09:46 +0530 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-13 19:03:39 -0400 |
commit | 1acd6de763b33f43b366c0298653734087001f5f (patch) | |
tree | 93a118a332cb422efef16de15ef20cda0825cdd2 | |
parent | 2d72a9e1d13fbcf9483eaf9ddb2a258d7aaf3ca2 (diff) | |
download | glib-1acd6de763b33f43b366c0298653734087001f5f.tar.gz |
meson: Use glib-mkenums directly instead of via build_mkenum.py
This is no longer needed because we use templates and custom targets
can capture output just fine on all platforms.
-rwxr-xr-x | gio/build_mkenum.py | 25 | ||||
-rw-r--r-- | gio/meson.build | 14 |
2 files changed, 8 insertions, 31 deletions
diff --git a/gio/build_mkenum.py b/gio/build_mkenum.py deleted file mode 100755 index 1ae2a9b8a..000000000 --- a/gio/build_mkenum.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 - -# This is in its own file rather than inside meson.build -# because a) mixing the two is ugly and b) trying to -# make special characters such as \n go through all -# backends is a fool's errand. - -import sys, os, shutil, subprocess - -python = sys.argv[1] -glib_mkenums = sys.argv[2] -ofilename = sys.argv[3] -ofile_rel = os.path.basename(ofilename) -template_file_dir = sys.argv[4] -template_file_path = template_file_dir + '/' + ofile_rel + '.template' -headers = sys.argv[5:] - -arg_array = ['--template', template_file_path] - -cmd = [python, glib_mkenums] -pc = subprocess.Popen(cmd + arg_array + headers, stdout=subprocess.PIPE) -(stdo, _) = pc.communicate() -if pc.returncode != 0: - sys.exit(pc.returncode) -open(ofilename, 'wb').write(stdo) diff --git a/gio/meson.build b/gio/meson.build index 524634edf..80284e6f4 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -633,23 +633,25 @@ gio_headers += settings_headers gio_headers += gdbus_headers install_headers(gio_headers, subdir : 'glib-2.0/gio/') -gio_build_mkenum = find_program('build_mkenum.py') - +# We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums +# in PATH, which means you can't bootstrap glib with its own glib-mkenums. gioenumtypes_h = custom_target('gioenumtypes_h', output : 'gioenumtypes.h', + capture : true, input : gio_headers, install : true, install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'), - command : [gio_build_mkenum, python, glib_mkenums, - '@OUTPUT@', meson.current_source_dir(), + command : [python, glib_mkenums, + '--template', meson.current_source_dir() + '/gioenumtypes.h.template', '@INPUT@', gnetworking_h]) gioenumtypes_c = custom_target('gioenumtypes_c', output : 'gioenumtypes.c', + capture : true, input : gio_headers, depends : [gioenumtypes_h], - command : [gio_build_mkenum, python, glib_mkenums, - '@OUTPUT@', meson.current_source_dir(), + command : [python, glib_mkenums, + '--template', meson.current_source_dir() + '/gioenumtypes.c.template', '@INPUT@', gnetworking_h]) gioenumtypes_dep = declare_dependency(sources : [gioenumtypes_h]) |