File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
packages/node-smol-builder/scripts Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -1424,6 +1424,13 @@ async function main() {
14241424 configureFlags . unshift ( '--dest-cpu=x64' )
14251425 }
14261426
1427+ // On Windows, tell gyp to use VS 2022 via generator flag (bypasses auto-detection).
1428+ // https://github.com/nodejs/node/blob/main/BUILDING.md#windows
1429+ // https://github.com/nodejs/node/blob/main/tools/gyp/pylib/gyp/MSVSVersion.py
1430+ if ( WIN32 ) {
1431+ configureFlags . push ( '-G' , 'msvs_version=2022' )
1432+ }
1433+
14271434 // Windows uses configure.py directly, Unix uses ./configure wrapper script.
14281435 // Use whichBinSync to resolve full path to python.exe since we use shell: false.
14291436 const configureCommand = WIN32 ? whichBinSync ( 'python' ) : './configure'
@@ -1452,20 +1459,11 @@ async function main() {
14521459 // propagate environment variables to subprocesses.
14531460 const execOptions = {
14541461 cwd : NODE_DIR ,
1455- env : WIN32
1456- ? {
1457- ...process . env ,
1458- // Tell gyp to use VS 2022, bypassing auto-detection.
1459- // https://github.com/nodejs/node/blob/main/BUILDING.md#windows
1460- // https://github.com/nodejs/node/blob/main/tools/gyp/pylib/gyp/MSVSVersion.py
1461- GYP_MSVS_VERSION : '2022' ,
1462- }
1463- : process . env ,
1462+ env : process . env ,
14641463 shell : false ,
14651464 }
14661465 if ( WIN32 ) {
14671466 logger . log ( `DEBUG: Passing env with ${ Object . keys ( execOptions . env ) . length } variables (shell: false)` )
1468- logger . log ( `DEBUG: GYP_MSVS_VERSION = ${ execOptions . env . GYP_MSVS_VERSION } ` )
14691467 }
14701468
14711469 await exec ( configureCommand , configureArgs , execOptions )
You can’t perform that action at this time.
0 commit comments