mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: fix msvc finding (2)
This commit is contained in:
parent
317d15dbe9
commit
68864d0703
@ -138,19 +138,19 @@ fn find_vs(vswhere_dir, host_arch string) ?VsInstallation {
|
|||||||
res := os.exec('"$vswhere_dir\\Microsoft Visual Studio\\Installer\\vswhere.exe" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath') or {
|
res := os.exec('"$vswhere_dir\\Microsoft Visual Studio\\Installer\\vswhere.exe" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath') or {
|
||||||
return error(err)
|
return error(err)
|
||||||
}
|
}
|
||||||
res_output := res.output.trim_space().trim_right('\r\n')
|
path := res.output.trim_space().trim_right('\r\n')
|
||||||
// println('res: "$res"')
|
// println('res: "$res"')
|
||||||
version := os.read_file('$res_output\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt') or {
|
version := os.read_file('$path\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt') or {
|
||||||
// println('Unable to find msvc version')
|
// println('Unable to find msvc version')
|
||||||
return error('Unable to find vs installation')
|
return error('Unable to find vs installation')
|
||||||
}
|
}
|
||||||
version2 := version // TODO remove. cgen option bug if expr
|
version2 := version // TODO remove. cgen option bug if expr
|
||||||
// println('version: $version')
|
// println('version: $version')
|
||||||
v := if version.ends_with('\n') { version2[..version.len - 2] } else { version2 }
|
v := if version.ends_with('\n') { version2[..version.len - 2] } else { version2 }
|
||||||
lib_path := '$res.output\\VC\\Tools\\MSVC\\$v\\lib\\$host_arch'
|
lib_path := '$path\\VC\\Tools\\MSVC\\$v\\lib\\$host_arch'
|
||||||
include_path := '$res.output\\VC\\Tools\\MSVC\\$v\\include'
|
include_path := '$path\\VC\\Tools\\MSVC\\$v\\include'
|
||||||
if os.exists('$lib_path\\vcruntime.lib') {
|
if os.exists('$lib_path\\vcruntime.lib') {
|
||||||
p := '$res.output\\VC\\Tools\\MSVC\\$v\\bin\\Host$host_arch\\$host_arch'
|
p := '$path\\VC\\Tools\\MSVC\\$v\\bin\\Host$host_arch\\$host_arch'
|
||||||
// println('$lib_path $include_path')
|
// println('$lib_path $include_path')
|
||||||
return VsInstallation{
|
return VsInstallation{
|
||||||
exe_path: p
|
exe_path: p
|
||||||
|
Loading…
Reference in New Issue
Block a user