Skip to content

Commit

Permalink
Add extsources to vulkan-validation-layers + some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ImperatorS79 committed Feb 28, 2024
1 parent ca551c2 commit d268aa9
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions packages/v/vulkan-validationlayers/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ package("vulkan-validationlayers")
set_license("Apache-2.0")

if is_plat("android") then
add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download/sdk-$(version)/android-binaries-$(version).tar.gz",
{version = function (version) return version:gsub("%+", ".") end})
add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download/sdk-$(version)/android-binaries-$(version).tar.gz", {version = function (version)
local prefix = "sdk-"
if version:gt("1.3.261+1") then
prefix = "vulkan-sdk-"
end
return version:startswith("v") and version or prefix .. version:gsub("%+", ".")
end})

add_versions("1.3.275+0", "6e22fb13601c1e780c44a17497a3c999cc5207e52a09819e7c32ecd8439eff7a")
add_versions("1.2.198+0", "5436e974d6b3133b3454edf1910f76b9f869db8bbe086859b2abe32fdb539cbc")
add_versions("1.2.189+1", "b3e69b60a67a17b023825f9eb0ce1aef22e6b59d095afa204d883a9ce3d81021")
else
add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/sdk-$(version).tar.gz",
{version = function (version) return version:gsub("%+", ".") end})
add_urls("https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/$(version).tar.gz", {version = function (version)
local prefix = "sdk-"
if version:gt("1.3.261+1") then
prefix = "vulkan-sdk-"
end
return version:startswith("v") and version or prefix .. version:gsub("%+", ".")
end})

add_versions("1.3.275+0", "acfd84039109220129624b0ecb69980bbc3a858978c62b556dbe16efd0f26755")
add_versions("1.2.198+0", "4a70cc5da26baf873fcf69b081eeeda545515dd66e5904f18fee32b4d275593a")
add_versions("1.2.189+1", "d169ae71ae3ba12159df355b58f86f5635062c695d1deac9b97d5653561d517d")
add_versions("1.2.182+0", "e88492143c8b08154807e7ead0ac784365b14464bb5016c2800cbff176ff61e7")
Expand All @@ -24,12 +36,19 @@ package("vulkan-validationlayers")

add_deps("cmake")
add_deps("glslang", "spirv-headers", "spirv-tools")

if is_plat("windows") then
add_syslinks("Advapi32")
end

if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::vulkan-validation-layers")
elseif is_plat("linux") then
add_extsources("apt::vulkan-validationlayers-dev", "pacman::vulkan-extra-layers")
add_extsources("apt::vulkan-validationlayers-dev", "pacman::vulkan-validation-layers")
add_deps("ninja")
add_deps("wayland", "libxrandr", "libxcb", "libxkbcommon")
elseif is_plat("macosx") then
add_extsources("brew::vulkan-validationlayers")
end
end

Expand Down Expand Up @@ -89,7 +108,5 @@ package("vulkan-validationlayers")
assert(os.isfile(path.join(package:installdir("lib"), "x86", "libVkLayer_khronos_validation.so")))
assert(os.isfile(path.join(package:installdir("lib"), "armeabi-v7a", "libVkLayer_khronos_validation.so")))
assert(os.isfile(path.join(package:installdir("lib"), "arm64-v8a", "libVkLayer_khronos_validation.so")))
else
assert(package:has_cxxfuncs("getLayerOption", {includes = "layers/vk_layer_config.h"}))
end
end)

0 comments on commit d268aa9

Please sign in to comment.