Skip to content

Commit a4f609b

Browse files
committed
build: include system ICU headers with -isystem
With --error-on-warn now enabled in test-shared.yml, warnings emitted from third-party ICU headers (e.g. clang's -Wunnecessary-virtual-specifier in unicode/uniset.h) were turned into errors on x86_64-darwin. Pass system ICU include dirs via -isystem so only Node.js-specific warnings fail the build. Signed-off-by: Ayush Sharma <ayushsharma3310@gmail.com>
1 parent a232998 commit a4f609b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎configure.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2619,7 +2619,18 @@ def icu_download(path):
26192619
o['libraries'] += libs.split()
26202620
if cflags:
26212621
stripped_flags = [flag.strip() for flag in cflags.split('-I')]
2622-
o['include_dirs'] += [flag for flag in stripped_flags if flag]
2622+
# Pass system ICU headers via -isystem rather than -I so that warnings
2623+
# originating from them (e.g. clang's -Wunnecessary-virtual-specifier
2624+
# in unicode/uniset.h) are not turned into errors by --error-on-warn.
2625+
isystem_flags = []
2626+
for flag in stripped_flags:
2627+
if flag:
2628+
isystem_flags += ['-isystem', flag]
2629+
o['cflags'] += isystem_flags
2630+
o.setdefault('xcode_settings', {}).setdefault('OTHER_CFLAGS', [])
2631+
o['xcode_settings']['OTHER_CFLAGS'] += isystem_flags
2632+
if flavor == 'win':
2633+
o['include_dirs'] += [flag for flag in stripped_flags if flag]
26232634
# use the "system" .gyp
26242635
o['variables']['icu_gyp_path'] = 'tools/icu/icu-system.gyp'
26252636
return

0 commit comments

Comments
 (0)