From ca551c2b6a2c1e64cb0c162dea18c2b2dac13fa8 Mon Sep 17 00:00:00 2001 From: Arthur Laurent Date: Mon, 22 Jan 2024 15:21:57 +0100 Subject: [PATCH] Update unordered dense to v4.4.0 (+ add module support) (#3141) * update unordered_dense to v4.4.0 * add module support for unordered_dense * change module support config name --- packages/u/unordered_dense/xmake.lua | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/u/unordered_dense/xmake.lua b/packages/u/unordered_dense/xmake.lua index 446ed91109c..bfbd5f0fa52 100644 --- a/packages/u/unordered_dense/xmake.lua +++ b/packages/u/unordered_dense/xmake.lua @@ -11,12 +11,33 @@ package("unordered_dense") add_versions("v2.0.2", "d4be48c164fa2f49deb55354b33c335688da3bd4b2299b3a46b8092602f67556") add_versions("v3.0.0", "e73452d7c1e274b4a15b553c0904f1de4bcfa61b00514acd1eaad7deac805ef0") add_versions("v4.0.4", "b34a8c942963e3a647f1bbc192a6391cd56d7ae615b2ddc1601c1779b5792206") + add_versions("v4.4.0", "3976399793e8cb4db1409ce15610fbd9e5e406ced4745f262d393a9311efbd88") + add_configs("modules", {description = "Build with C++20 modules support.", default = false, type = "boolean"}) + + on_load(function (package) + if not package:config("modules") then + package:add("deps", "cmake") + end + end) - add_deps("cmake") on_install(function (package) - import("package.tools.cmake").install(package) - os.cp("include", package:installdir()) + if not package:config("modules") then + import("package.tools.cmake").install(package) + os.cp("include", package:installdir()) + else + os.cp("src/ankerl.unordered_dense.cpp", "src/ankerl.unordered_dense.cppm") + io.writefile("xmake.lua", [[ + target("unordered_dense") + set_kind("static") + set_languages("c++20") + add_headerfiles("include/(**.h)") + add_includedirs("include") + add_files("src/**.cppm", {public = true}) + ]]) + local configs = {} + import("package.tools.xmake").install(package, configs) + end end) on_test(function (package)