Revert "vulkan-hpp: update to v1.2.281, fix MSVC bug" (#3961)

* Revert "vulkan-hpp: update to v1.2.281, fix MSVC bug (#3720)"

This reverts commit f3e196f43b.

* Update xmake.lua
pull/3978/head
c8ef 7 months ago committed by GitHub
parent fdd7ef24c0
commit b729ff0e9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 36
      packages/v/vulkan-hpp/xmake.lua

@ -25,9 +25,10 @@ package("vulkan-hpp")
add_versions("v1.3.279", "6fb8def27290f8b87d7835457a9c68190aed9a9a")
add_versions("v1.3.280", "e35acfe75215116029298aebf681170559a4fe6a")
add_versions("v1.3.281", "88d508b32f207ba85b37fe22fe3732322d1c248d")
add_versions("v1.3.282", "4bf2835dd1a530291cd2b340a58dd7e369d5c86c")
add_versions("v1.3.283", "2fbc146feefa43b8201af4b01eb3570110f9fa32")
add_configs("modules", {description = "Build with C++20 modules support.", default = false, type = "boolean"})
add_configs("msvc_modules", {description = "If 'modules' enabled, and you wish to use MSVC on the package, enable this to avoid a known bug of MSVC.", default = false, type = "boolean"})
on_load(function (package)
if not package:config("modules") then
@ -38,8 +39,8 @@ package("vulkan-hpp")
end
end)
-- TODO: add android, windows|x86, mingw|i386 target
on_install("windows|x64", "linux", "macosx", "mingw|x86_64", "iphoneos", function (package)
on_install("windows|x86", "windows|x64", "linux", "macosx", "mingw", "android", "iphoneos", function (package)
local arch_prev
local plat_prev
if (package:is_plat("mingw") or package:is_cross()) and package.plat_set then
@ -63,23 +64,6 @@ package("vulkan-hpp")
if not package:config("modules") then
os.cp("Vulkan-Headers/include", package:installdir())
os.cp("vulkan/*.hpp", package:installdir(path.join("include", "vulkan")))
else
if package:config("msvc_modules") then
io.writefile("xmake.lua", [[
target("vulkan-hpp")
set_kind("moduleonly")
set_languages("c++20")
set_toolchains("msvc")
add_cxflags("/EHsc")
add_headerfiles("Vulkan-Headers/include/(**.h)")
add_headerfiles("Vulkan/(**.h)")
add_headerfiles("Vulkan-Headers/include/(**.hpp)")
add_headerfiles("Vulkan/(**.hpp)")
add_includedirs("Vulkan")
add_includedirs("Vulkan-Headers/include")
add_files("Vulkan/vulkan.cppm")
add_defines("VULKAN_HPP_NO_SMART_HANDLE")
]])
else
io.writefile("xmake.lua", [[
target("vulkan-hpp")
@ -93,12 +77,20 @@ package("vulkan-hpp")
add_includedirs("Vulkan-Headers/include")
add_files("Vulkan/vulkan.cppm", {public = true})
]])
end
local configs = {}
import("package.tools.xmake").install(package, configs)
end
end)
on_test(function (package)
assert(package:has_cxxincludes("vulkan/vulkan.hpp", {configs = {languages = "c++14"}}))
assert(package:check_cxxsnippets({test = [[
void test() {
vk::ApplicationInfo ai;
ai.pApplicationName = "Test";
ai.applicationVersion = VK_MAKE_API_VERSION(1,0,0,0);
ai.pEngineName = "Test";
ai.engineVersion = VK_MAKE_API_VERSION(1,0,0,0);
ai.apiVersion = VK_API_VERSION_1_0;
}
]]}, {includes = "vulkan/vulkan.hpp", configs = {languages = "c++14"} }))
end)

Loading…
Cancel
Save