Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arm64 for msvc #2728

Merged
merged 4 commits into from
Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions xmake/modules/detect/sdks/find_vstudio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt)
file:print("set VSCMD_SKIP_SENDTELEMETRY=yes")
end
if opt.vcvars_ver then
file:print("call \"%s\" %s %s -vcvars_ver=%s > nul", vcvarsall, arch, opt.sdkver and opt.sdkver or "", opt.vcvars_ver)
file:print("call \"%s\" %s %s -vcvars_ver=%s > nul", vcvarsall, arch, opt.sdkver and opt.sdkver or "", opt.vcvars_ver)
else
file:print("call \"%s\" %s %s > nul", vcvarsall, arch, opt.sdkver and opt.sdkver or "")
end
Expand Down Expand Up @@ -321,8 +321,20 @@ function _find_vstudio(opt)
local vcvarsall_x86 = _load_vcvarsall(vcvarsall, version, "x86", opt)
local vcvarsall_x64 = _load_vcvarsall(vcvarsall, version, "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
results[vsvers[version]] = {version = version, vcvarsall_bat = vcvarsall, vcvarsall = {x86 = vcvarsall_x86, x64 = vcvarsall_x64}}
results[vsvers[version]] = {version = version, vcvarsall_bat = vcvarsall, vcvarsall = {x86 = vcvarsall_x86, x64 = vcvarsall_x64, arm64 = vcvarsall_arm64}}
end
end
return results
Expand Down
2 changes: 1 addition & 1 deletion xmake/platforms/windows/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ platform("windows")
set_hosts("windows")

-- set archs
set_archs("x86", "x64")
set_archs("x86", "x64", "arm64")

-- set formats
set_formats("static", "$(name).lib")
Expand Down