From eb997973d775b54c18c61005d3c0889e82cdcb31 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Mon, 16 Jun 2025 11:44:36 +0200 Subject: [PATCH] Detect vsvars path --- base/tools/make.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/base/tools/make.js b/base/tools/make.js index 3c228dbb..33719372 100644 --- a/base/tools/make.js +++ b/base/tools/make.js @@ -135,7 +135,7 @@ function os_exec(exe, params = [], ops = {}) { let res = { status: 0 }; if (os_platform() === "win32") { - res.status = amake.os_exec_win(params, ops); + res.stdout = amake.os_exec_win(params, ops); res.status = 0; } else { @@ -3240,9 +3240,8 @@ function main() { make = os_exec('xcodebuild', xcode_options, { cwd: "build" }); } else if (goptions.target == 'windows') { - // let vswhere = path_join(os_env('ProgramFiles(x86)'), 'Microsoft Visual Studio', 'Installer', 'vswhere.exe'); - // let vsvars = os_exec(vswhere, ['-products', '*', '-latest', '-find', 'VC\\Auxiliary\\Build\\vcvars64.bat']).trim(); - let vsvars = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat"; + let vswhere = path_join(os_env('ProgramFiles(x86)'), 'Microsoft Visual Studio', 'Installer', 'vswhere.exe'); + let vsvars = os_exec(vswhere, ['-products', '*', '-latest', '-find', 'VC\\Auxiliary\\Build\\vcvars64.bat']).stdout.trim(); fs_writefile(path_join("build", 'build.bat'), '@call "' + vsvars + '"\n' + '@MSBuild.exe "' + path_resolve("build", project_name + '.vcxproj') + '" /m /clp:ErrorsOnly /p:Configuration=' + (goptions.debug ? 'Debug' : 'Release') + ',Platform=x64'); make = os_exec('build.bat', [], { cwd: "build" }); }