build: only mention Apple when on Apple

PR-URL: https://github.com/nodejs/node/pull/59385
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
This commit is contained in:
Michaël Zasso 2025-08-09 10:01:11 +02:00 committed by GitHub
parent 21eac793cd
commit 7079041e0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1301,7 +1301,7 @@ def check_compiler(o):
if not ok: if not ok:
warn(f'failed to autodetect C++ compiler version (CXX={CXX})') warn(f'failed to autodetect C++ compiler version (CXX={CXX})')
elif (is_apple and clang_version < (17, 0, 0) or not is_apple and clang_version < (19, 1, 0)) if is_clang else gcc_version < (12, 2, 0): elif (is_apple and clang_version < (17, 0, 0) or not is_apple and clang_version < (19, 1, 0)) if is_clang else gcc_version < (12, 2, 0):
warn(f'C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0, clang++ 19.1.0, or Apple clang++ 17.0.0') warn(f"C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0 or clang++ 19.1.0{' or Apple clang++ 17.0.0' if is_apple else ''}")
ok, is_clang, clang_version, gcc_version, is_apple = try_check_compiler(CC, 'c') ok, is_clang, clang_version, gcc_version, is_apple = try_check_compiler(CC, 'c')
version_str = ".".join(map(str, clang_version if is_clang else gcc_version)) version_str = ".".join(map(str, clang_version if is_clang else gcc_version))