diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2022-03-23 12:15:36 +0000 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2022-04-21 12:34:06 +0100 |
commit | f8c9ec5387d0afdd920b53581ebb1107a20a2fc2 (patch) | |
tree | 2e6f6e550070374228c727b8c0cf7a716be508d5 | |
parent | 47b434b1421466a5ac05ee2a8413170450bb40fe (diff) | |
download | libvirt-python-f8c9ec5387d0afdd920b53581ebb1107a20a2fc2.tar.gz |
generator: introduce ability to selectively generate code
Currently we always generate both the C code and Python code at the same
time. To cope with following changes to the build process, we want to be
able to generate C and Python separately.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-rwxr-xr-x | generator.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/generator.py b/generator.py index 7faec69..71341de 100755 --- a/generator.py +++ b/generator.py @@ -1781,7 +1781,13 @@ quiet = False if not os.path.exists("build"): os.mkdir("build") -emit_c_code(sys.argv[1]) +output = None +if len(sys.argv) == 4: + output = sys.argv[3] +if output == "c" or output is None: + emit_c_code(sys.argv[1]) + +if output == "py" or output is None: + emit_py_code(sys.argv[1]) -emit_py_code(sys.argv[1]) sys.exit(0) |