Skip to content
Merged
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
26 changes: 23 additions & 3 deletions xmake/modules/detect/sdks/find_dia_sdk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function _find_dia_sdk(sdkdir, opt)
end

-- get arch
local arch = opt.arch or config.get("arch")
local arch = opt.arch or config.get("arch") or os.arch()
if arch then
local supported_arch = {
x64 = "amd64",
Expand Down Expand Up @@ -110,7 +110,6 @@ end
-- @endcode
--
function main(sdkdir, opt)
-- init options
opt = opt or {}

-- attempt to load cache first
Expand All @@ -122,6 +121,27 @@ function main(sdkdir, opt)

-- find dia sdk
local dia_sdk = _find_dia_sdk(sdkdir, opt)
if not dia_sdk then
local vstudio = find_vstudio()
if vstudio then
for vsver, value in pairs(vstudio) do
if value.vcvarsall then
for arch, vcvarsall_value in pairs(value.vcvarsall) do
local VSInstallDir = vcvarsall_value.VSInstallDir
if VSInstallDir then
dia_sdk = _find_dia_sdk(VSInstallDir, opt)
if dia_sdk then
goto found
end
end
end
end
end
end
end

::found::

if dia_sdk then
if opt.verbose or option.get("verbose") then
cprint("checking for DIA SDK directory ... ${color.success}%s", dia_sdk.sdkdir)
Expand All @@ -137,4 +157,4 @@ function main(sdkdir, opt)
detectcache:set(key, cacheinfo)
detectcache:save()
return dia_sdk
end
end
Loading