mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
build,win: fix VS2022 arm64 PGO build
Refs: https://github.com/nodejs/node/pull/62761 Signed-off-by: StefanStojanovic <stefan.stojanovic@janeasystems.com> PR-URL: https://github.com/nodejs/node/pull/63413 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
This commit is contained in:
1 parent
956e2a2b86
commit
55b8a30319
1 file changed
+20
-9
+20
-9
@@ -1965,18 +1965,29 @@ def configure_node(o):
|
||||
msvc_dir = target_arch # 'x64' or 'arm64'
|
||||
|
||||
vc_tools_dir = os.environ.get('VCToolsInstallDir', '')
|
||||
if vc_tools_dir:
|
||||
clang_profile_lib = os.path.join(vc_tools_dir, 'lib', msvc_dir, lib_name)
|
||||
if os.path.isfile(clang_profile_lib):
|
||||
o['variables']['clang_profile_lib'] = clang_profile_lib
|
||||
else:
|
||||
raise Exception(
|
||||
f'PGO profile runtime library not found at {clang_profile_lib}. '
|
||||
'Ensure the ClangCL toolset is installed.')
|
||||
else:
|
||||
if not vc_tools_dir:
|
||||
raise Exception(
|
||||
'VCToolsInstallDir not set. Run from a Visual Studio command prompt.')
|
||||
|
||||
# Primary location: VS2026 and VS2022 x64
|
||||
candidates = [os.path.join(vc_tools_dir, 'lib', msvc_dir, lib_name)]
|
||||
|
||||
# Secondary location: VS2022 arm64 fallback
|
||||
clang_major = options.clang_cl.split('.', 1)[0]
|
||||
candidates.append(os.path.normpath(os.path.join(
|
||||
vc_tools_dir, '..', '..', 'Llvm', msvc_dir,
|
||||
'lib', 'clang', clang_major, 'lib', 'windows', lib_name)))
|
||||
|
||||
clang_profile_lib = next(
|
||||
(p for p in candidates if os.path.isfile(p)), None)
|
||||
if clang_profile_lib:
|
||||
o['variables']['clang_profile_lib'] = clang_profile_lib
|
||||
else:
|
||||
raise Exception(
|
||||
f'PGO profile runtime library {lib_name} not found. Searched:\n ' +
|
||||
'\n '.join(candidates) +
|
||||
'\nEnsure the ClangCL toolset is installed.')
|
||||
|
||||
if flavor != 'win' and options.enable_thin_lto:
|
||||
raise Exception(
|
||||
'Use --enable-lto instead.')
|
||||
|
||||
Reference in new issue
Block a user