From 341e6c667696c90c9e6efee6b778f349cf24a52f Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 27 Dec 2023 23:25:55 +0800 Subject: [PATCH] libmorton: add package (#3002) --- packages/l/libmorton/xmake.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/l/libmorton/xmake.lua diff --git a/packages/l/libmorton/xmake.lua b/packages/l/libmorton/xmake.lua new file mode 100644 index 000000000..827114b22 --- /dev/null +++ b/packages/l/libmorton/xmake.lua @@ -0,0 +1,25 @@ +package("libmorton") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/Forceflow/libmorton") + set_description("C++ header-only library with methods to efficiently encode/decode Morton codes in/from 2D/3D coordinates") + set_license("MIT") + + add_urls("https://github.com/Forceflow/libmorton/archive/refs/tags/$(version).tar.gz", + "https://github.com/Forceflow/libmorton.git") + + add_versions("v0.2.12", "48ec3e4ad1d9348052dcb64bff012ff95db226da3fec5522ae6e674fabbd686f") + + add_deps("cmake") + + on_install(function (package) + import("package.tools.cmake").install(package, {"-DBUILD_TESTING=OFF"}) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + libmorton::morton2D_32_encode(0, 0); + } + ]]}, {configs = {languages = "c++11"}})) + end)