diff options
| author | dragonflylee <[email protected]> | 2023-12-18 16:46:55 +0800 |
|---|---|---|
| committer | dragonflylee <[email protected]> | 2023-12-18 16:46:55 +0800 |
| commit | ad2b845132d491c7bb0e567f7e19deb24b80affd (patch) | |
| tree | 776ebd5abd5f7cb28e5a5a1547760be4f1bd80c4 | |
| parent | b5e571f970716e31c24e7c98112e16ac55ead624 (diff) | |
Fix vstudio arm64 dectect under Developer Command Prompt
| -rw-r--r-- | xmake/modules/detect/sdks/find_vstudio.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 0702bee9b..a95c48059 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -242,9 +242,21 @@ function _find_vstudio(opt) local vcvarsall_x86 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "x86", opt) local vcvarsall_x64 = _load_vcvarsall(vcvarsall, VisualStudioVersion, "x64", opt) + -- load vcvarsall for arm64 + local arch + local arch_os = os.arch() + if arch_os == "x64" then + arch = "x64_arm64" + elseif arch_os == "x86" then + arch = "x86_arm64" + elseif arch_os == "arm64" then + arch = "arm64" + end + local vcvarsall_arm64 = arch and _load_vcvarsall(vcvarsall, version, arch, opt) or nil + -- save results local results = {} - results[vsvers[VisualStudioVersion]] = {version = VisualStudioVersion, vcvarsall_bat = vcvarsall, vcvarsall = {x86 = vcvarsall_x86, x64 = vcvarsall_x64}} + results[vsvers[VisualStudioVersion]] = {version = VisualStudioVersion, vcvarsall_bat = vcvarsall, vcvarsall = {x86 = vcvarsall_x86, x64 = vcvarsall_x64, arm64 = vcvarsall_arm64}} return results end end |
