package("diasdk")
    set_homepage("https://visualstudio.microsoft.com/")
    set_description("The Microsoft Debug Interface Access (DIA) SDK provides access to debug information stored in program database (.pdb) files generated by Microsoft postcompiler tools.")

    on_fetch("windows|x64", "windows|arm", "windows|arm64", function (package, opt)
        if opt.system then
            import("detect.sdks.find_dia_sdk")

            local dia_sdk = find_dia_sdk(nil, {arch = package:arch()})
            if dia_sdk then
                return {
                    includedirs = dia_sdk.includedirs,
                    linkdirs = dia_sdk.linkdirs,
                    links = {
                        package:config("shared") and "msdia140" or "diaguids"
                    }
                }
            end
        end
    end)
