From cabbc97147c9533e0f6f4a7454b65ee91290ae10 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 13 Dec 2023 04:44:13 +0000 Subject: [PATCH] build: build opt to set local location of headers Some linux distroes install headers through their package managers. When headers are locally installed we'd like them to be used. Add a build time configuration option --use-prefix-to-find-headers that will will suggest to node-gyp to look for headers based on the prefix A PR to node-gyp will use this value when building addons to automatially find and use the headers if they have been installed locally Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/51525 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca --- configure.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.py b/configure.py index 5e014bf7a75e2a..ec4f31f69a46d3 100755 --- a/configure.py +++ b/configure.py @@ -122,6 +122,12 @@ default=None, help='force build to be considered as NOT cross compiled') +parser.add_argument('--use-prefix-to-find-headers', + action='store_true', + dest='use_prefix_to_find_headers', + default=None, + help='use the prefix to look for pre-installed headers') + parser.add_argument('--dest-os', action='store', dest='dest_os', @@ -1249,6 +1255,7 @@ def configure_node(o): o['variables']['debug_node'] = b(options.debug_node) o['default_configuration'] = 'Debug' if options.debug else 'Release' o['variables']['error_on_warn'] = b(options.error_on_warn) + o['variables']['use_prefix_to_find_headers'] = b(options.use_prefix_to_find_headers) host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc() target_arch = options.dest_cpu or host_arch