summaryrefslogtreecommitdiff
path: root/giscanner/scannermain.py
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-06-23 23:04:06 +0100
committerEmmanuele Bassi <ebassi@gmail.com>2022-02-12 15:45:01 +0000
commit698a53859ae6cbdf351e0299d4d31227731bd706 (patch)
tree2c7c05c4dad305f4d37c1ec35dffe708496b3452 /giscanner/scannermain.py
parente9956657be16c102a57443e474a5206756e40548 (diff)
downloadgobject-introspection-698a53859ae6cbdf351e0299d4d31227731bd706.tar.gz
Add --compiler argument to g-ir-scanner
We currently use the `CC` environment variable to find the C compiler to use internally in g-ir-scanner. Build systems might wish to store the compiler detected during the build configuration, and then pass that compiler to g-ir-scanner at the time of build, avoiding to put things into the environment. One possible solution is to have a command line argument that lets us specify the C compiler, with the same semantics as the `CC` environment variable.
Diffstat (limited to 'giscanner/scannermain.py')
-rw-r--r--giscanner/scannermain.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 576f78ac..64575557 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -217,6 +217,9 @@ match the namespace prefix.""")
parser.add_option("", "--filelist",
action="store", dest="filelist", default=[],
help="file containing headers and sources to be scanned")
+ parser.add_option("", "--compiler",
+ action="store", dest="compiler", default=None,
+ help="the C compiler to use internally")
group = get_preprocessor_option_group(parser)
parser.add_option_group(group)
@@ -458,6 +461,7 @@ def create_source_scanner(options, args):
# Run the preprocessor, tokenize and construct simple
# objects representing the raw C symbols
ss = SourceScanner()
+ ss.set_compiler(options.compiler)
ss.set_cpp_options(options.cpp_includes,
options.cpp_defines,
options.cpp_undefines,