From 1b81a7d003ab75dfa4495b3aa0901015d425f691 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 3 Dec 2024 15:17:48 +0100 Subject: [PATCH] build: allow overriding clang usage PR-URL: https://github.com/nodejs/node/pull/56016 Reviewed-By: Yagiz Nizipli Reviewed-By: Richard Lau --- configure.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure.py b/configure.py index a4e210261e2e76..e2b12d8823bb64 100755 --- a/configure.py +++ b/configure.py @@ -131,6 +131,12 @@ default=None, help='use the prefix to look for pre-installed headers') +parser.add_argument('--use_clang', + action='store_true', + dest='use_clang', + default=None, + help='use clang instead of gcc') + parser.add_argument('--dest-os', action='store', dest='dest_os', @@ -1407,6 +1413,10 @@ def configure_node(o): o['variables']['target_arch'] = target_arch o['variables']['node_byteorder'] = sys.byteorder + # Allow overriding the compiler - needed by embedders. + if options.use_clang: + o['variables']['clang'] = 1 + cross_compiling = (options.cross_compiling if options.cross_compiling is not None else target_arch != host_arch)