From b729ff0e9c10d55fb7c210d01ff9955dcd935596 Mon Sep 17 00:00:00 2001 From: c8ef Date: Tue, 7 May 2024 20:38:28 +0800 Subject: [PATCH] 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 f3e196f43b1d43e8692207a6ba08c55e1c58702a. * Update xmake.lua --- packages/v/vulkan-hpp/xmake.lua | 60 ++++++++++++++------------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/packages/v/vulkan-hpp/xmake.lua b/packages/v/vulkan-hpp/xmake.lua index 37b968a6a..8fb72f784 100644 --- a/packages/v/vulkan-hpp/xmake.lua +++ b/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 @@ -64,41 +65,32 @@ package("vulkan-hpp") 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") - set_kind("static") - set_languages("c++20") - 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", {public = true}) - ]]) - end + io.writefile("xmake.lua", [[ + target("vulkan-hpp") + set_kind("static") + set_languages("c++20") + 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", {public = true}) + ]]) 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)