| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -642,14 +642,22 @@ Optional requirements to build the MSI installer package: | |||
| 642 | 642 | * The .NET SDK component from [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) | |
| 643 | 643 | * This component can be installed via the Visual Studio Installer Application | |
| 644 | 644 | ||
| 645 | - Optional requirements for compiling for Windows 10 on ARM (ARM64): | ||
| 645 | + Optional requirements for compiling for Windows on ARM (ARM64): | ||
| 646 | 646 | ||
| 647 | 647 | * Visual Studio 17.6.0 or newer | |
| 648 | 648 | * Visual Studio optional components | |
| 649 | 649 | * Visual C++ compilers and libraries for ARM64 | |
| 650 | 650 | * Visual C++ ATL for ARM64 | |
| 651 | 651 | * Windows 10 SDK 10.0.17763.0 or newer | |
| 652 | 652 | ||
| 653 | + Optional requirements for compiling with ClangCL: | ||
| 654 | + | ||
| 655 | + * Visual Studio optional components | ||
| 656 | + * C++ Clang Compiler for Windows | ||
| 657 | + * MSBuild support for LLVM toolset | ||
| 658 | + | ||
| 659 | + NOTE: Currently we only support compiling with Clang that comes from Visual Studio. | ||
| 660 | + | ||
| 653 | 661 | ##### Option 2: Automated install with Boxstarter | |
| 654 | 662 | ||
| 655 | 663 | A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,11 +13,16 @@ if not exist "%InstallerPath%" goto :no-vswhere | |||
| 13 | 13 | set "Path=%Path%;%InstallerPath%" | |
| 14 | 14 | where vswhere 2> nul > nul | |
| 15 | 15 | if errorlevel 1 goto :no-vswhere | |
| 16 | + :: VC.Tools are needed even when using clang because of the vcvarsall.bat usage | ||
| 16 | 17 | if "%2"=="arm64" ( | |
| 17 | 18 | set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.ARM64 | |
| 18 | 19 | ) else ( | |
| 19 | 20 | set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 | |
| 20 | 21 | ) | |
| 22 | + if "%4"=="1" ( | ||
| 23 | + set VSWHERE_REQ=%VSWHERE_REQ% -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang | ||
| 24 | + set VSWHERE_REQ=%VSWHERE_REQ% -requires Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset | ||
| 25 | + ) | ||
| 21 | 26 | set VSWHERE_PRP=-property installationPath | |
| 22 | 27 | set VSWHERE_LMT=-version %1 | |
| 23 | 28 | vswhere -prerelease > nul | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,8 +187,6 @@ if defined nosnapshot set configure_flags=%configure_flags% --without-snap | |||
| 187 | 187 | if defined nonpm set configure_flags=%configure_flags% --without-npm | |
| 188 | 188 | if defined nocorepack set configure_flags=%configure_flags% --without-corepack | |
| 189 | 189 | if defined ltcg set configure_flags=%configure_flags% --with-ltcg | |
| 190 | - :: If clang-cl build is requested, set it to 17.0, which is the version shipped with VS 2022. | ||
| 191 | - if defined clang_cl set configure_flags=%configure_flags% --clang-cl=17.0 | ||
| 192 | 190 | if defined release_urlbase set configure_flags=%configure_flags% --release-urlbase=%release_urlbase% | |
| 193 | 191 | if defined download_arg set configure_flags=%configure_flags% %download_arg% | |
| 194 | 192 | if defined enable_vtune_arg set configure_flags=%configure_flags% --enable-vtune-profiling | |
@@ -254,7 +252,7 @@ echo Looking for Visual Studio 2022 | |||
| 254 | 252 | @rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to | |
| 255 | 253 | @rem detect the version searched for | |
| 256 | 254 | if not defined target_env set "VCINSTALLDIR=" | |
| 257 | - call tools\msvs\vswhere_usability_wrapper.cmd "[17.6,18.0)" %target_arch% "prerelease" | ||
| 255 | + call tools\msvs\vswhere_usability_wrapper.cmd "[17.6,18.0)" %target_arch% "prerelease" %clang_cl% | ||
| 258 | 256 | if "_%VCINSTALLDIR%_" == "__" goto msbuild-not-found | |
| 259 | 257 | @rem check if VS2022 is already setup, and for the requested arch | |
| 260 | 258 | if "_%VisualStudioVersion%_" == "_17.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2022 | |
@@ -274,13 +272,34 @@ set PLATFORM_TOOLSET=v143 | |||
| 274 | 272 | goto msbuild-found | |
| 275 | 273 | ||
| 276 | 274 | :msbuild-not-found | |
| 277 | - echo Failed to find a suitable Visual Studio installation. | ||
| 275 | + set "clang_echo=" | ||
| 276 | + if defined clang_cl set "clang_echo= or Clang compiler/LLVM toolset" | ||
| 277 | + echo Failed to find a suitable Visual Studio installation%clang_echo%. | ||
| 278 | 278 | echo Try to run in a "Developer Command Prompt" or consult | |
| 279 | 279 | echo https://github.com/nodejs/node/blob/HEAD/BUILDING.md#windows | |
| 280 | 280 | goto exit | |
| 281 | 281 | ||
| 282 | 282 | :msbuild-found | |
| 283 | 283 | ||
| 284 | + @rem check if the clang-cl build is requested | ||
| 285 | + if not defined clang_cl goto clang-skip | ||
| 286 | + @rem x64 is hard coded as it is used for both cross and native compilation. | ||
| 287 | + set "clang_path=%VCINSTALLDIR%\Tools\Llvm\x64\bin\clang.exe" | ||
| 288 | + for /F "tokens=3" %%i in ('"%clang_path%" --version') do ( | ||
| 289 | + set clang_version=%%i | ||
| 290 | + goto clang-found | ||
| 291 | + ) | ||
| 292 | + | ||
| 293 | + :clang-not-found | ||
| 294 | + echo Failed to find Clang compiler in %clang_path%. | ||
| 295 | + goto exit | ||
| 296 | + | ||
| 297 | + :clang-found | ||
| 298 | + echo Found Clang version %clang_version% | ||
| 299 | + set configure_flags=%configure_flags% --clang-cl=%clang_version% | ||
| 300 | + | ||
| 301 | + :clang-skip | ||
| 302 | + | ||
| 284 | 303 | set project_generated= | |
| 285 | 304 | :project-gen | |
| 286 | 305 | @rem Skip project generation if requested. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments