Skip to content

Commit

Permalink
build: build opt to set local location of headers
Browse files Browse the repository at this point in the history
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 <midawson@redhat.com>
PR-URL: #51525
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
mhdawson authored and richardlau committed Mar 25, 2024
1 parent 4bc8e98 commit 4f49e9d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4f49e9d

Please sign in to comment.