Skip to content

build(llvm-win32): support CMAKE_GENERATOR and newer Visual Studio releases in build.mjs - #327

Open
euxaristia wants to merge 2 commits into
vercel-labs:mainfrom
euxaristia:fix/llvm-win32-cmake-generator
Open

euxaristia wants to merge 2 commits into
vercel-labs:mainfrom
euxaristia:fix/llvm-win32-cmake-generator

Conversation

@euxaristia

Copy link
Copy Markdown
Contributor

Summary

Resolves #326 by allowing packages/llvm-win32-x64-msvc/scripts/build.mjs to work on systems with Visual Studio 18 2026 or custom CMake generators, rather than failing on hardcoded Visual Studio 17 2022.

Changes

  • Respect process.env.CMAKE_GENERATOR when set.
  • Probe vswhere.exe for installed Visual Studio major versions (18, 17, 16) as automatic fallback.
  • Only pass -A x64 when using a Visual Studio generator.

Test plan

  • Verified packages/llvm-win32-x64-msvc/scripts/build.mjs configures with Visual Studio 18 2026 and compiles scriptc-llvm-codegen.exe via MSBuild.
  • Verified execution skips cleanly on Linux/POSIX hosts.

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@euxaristia is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread packages/llvm-win32-x64-msvc/scripts/build.mjs
Comment thread packages/compiler/src/frontend/lowering/lower-builtins.ts Outdated
…leases

`packages/llvm-win32-x64-msvc/scripts/build.mjs` previously hardcoded
`-G "Visual Studio 17 2022"`, failing on systems with Visual Studio 18 2026
or where a custom generator was configured. Respect `process.env.CMAKE_GENERATOR`
if defined, or probe `vswhere.exe` for installed Visual Studio major versions
(18/17/16), only passing `-A x64` for Visual Studio generators.

Fixes vercel-labs#326
@euxaristia
euxaristia force-pushed the fix/llvm-win32-cmake-generator branch from b452a9d to 0748462 Compare September 17, 2026 13:33
Pass -DCMAKE_BUILD_TYPE=Release when configuring with single-config
generators such as Ninja, and probe candidate output directories
before copying scriptc-llvm-codegen.exe to prevent ENOENT.

Refs vercel-labs#326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build(llvm-win32): support CMAKE_GENERATOR and newer Visual Studio versions in build.mjs

1 participant