From a4f609b2774a0b91aa966f535da229edbf05037d Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Thu, 22 Oct 2026 17:34:18 +0530 Subject: [PATCH] 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 --- configure.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 5a30e76b1d84..43f66f0f4220 100755 --- a/configure.py +++ b/configure.py @@ -2619,7 +2619,18 @@ def icu_download(path): o['libraries'] += libs.split() if cflags: stripped_flags = [flag.strip() for flag in cflags.split('-I')] - o['include_dirs'] += [flag for flag in stripped_flags if flag] + # Pass system ICU headers via -isystem rather than -I so that warnings + # originating from them (e.g. clang's -Wunnecessary-virtual-specifier + # in unicode/uniset.h) are not turned into errors by --error-on-warn. + isystem_flags = [] + for flag in stripped_flags: + if flag: + isystem_flags += ['-isystem', flag] + o['cflags'] += isystem_flags + o.setdefault('xcode_settings', {}).setdefault('OTHER_CFLAGS', []) + o['xcode_settings']['OTHER_CFLAGS'] += isystem_flags + if flavor == 'win': + o['include_dirs'] += [flag for flag in stripped_flags if flag] # use the "system" .gyp o['variables']['icu_gyp_path'] = 'tools/icu/icu-system.gyp' return