| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1749,18 +1749,29 @@ def configure_node(o): | |||
| 1749 | 1749 | msvc_dir = target_arch # 'x64' or 'arm64' | |
| 1750 | 1750 | ||
| 1751 | 1751 | vc_tools_dir = os.environ.get('VCToolsInstallDir', '') | |
| 1752 | - if vc_tools_dir: | ||
| 1753 | - clang_profile_lib = os.path.join(vc_tools_dir, 'lib', msvc_dir, lib_name) | ||
| 1754 | - if os.path.isfile(clang_profile_lib): | ||
| 1755 | - o['variables']['clang_profile_lib'] = clang_profile_lib | ||
| 1756 | - else: | ||
| 1757 | - raise Exception( | ||
| 1758 | - f'PGO profile runtime library not found at {clang_profile_lib}. ' | ||
| 1759 | - 'Ensure the ClangCL toolset is installed.') | ||
| 1760 | - else: | ||
| 1752 | + if not vc_tools_dir: | ||
| 1761 | 1753 | raise Exception( | |
| 1762 | 1754 | 'VCToolsInstallDir not set. Run from a Visual Studio command prompt.') | |
| 1763 | 1755 | ||
| 1756 | + # Primary location: VS2026 and VS2022 x64 | ||
| 1757 | + candidates = [os.path.join(vc_tools_dir, 'lib', msvc_dir, lib_name)] | ||
| 1758 | + | ||
| 1759 | + # Secondary location: VS2022 arm64 fallback | ||
| 1760 | + clang_major = options.clang_cl.split('.', 1)[0] | ||
| 1761 | + candidates.append(os.path.normpath(os.path.join( | ||
| 1762 | + vc_tools_dir, '..', '..', 'Llvm', msvc_dir, | ||
| 1763 | + 'lib', 'clang', clang_major, 'lib', 'windows', lib_name))) | ||
| 1764 | + | ||
| 1765 | + clang_profile_lib = next( | ||
| 1766 | + (p for p in candidates if os.path.isfile(p)), None) | ||
| 1767 | + if clang_profile_lib: | ||
| 1768 | + o['variables']['clang_profile_lib'] = clang_profile_lib | ||
| 1769 | + else: | ||
| 1770 | + raise Exception( | ||
| 1771 | + f'PGO profile runtime library {lib_name} not found. Searched:\n ' + | ||
| 1772 | + '\n '.join(candidates) + | ||
| 1773 | + '\nEnsure the ClangCL toolset is installed.') | ||
| 1774 | + | ||
| 1764 | 1775 | if flavor != 'win' and options.enable_thin_lto: | |
| 1765 | 1776 | raise Exception( | |
| 1766 | 1777 | 'Use --enable-lto instead.') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments