diff --git a/packages/c/cglm/xmake.lua b/packages/c/cglm/xmake.lua new file mode 100644 index 000000000..3310290c8 --- /dev/null +++ b/packages/c/cglm/xmake.lua @@ -0,0 +1,26 @@ +package("cglm") + set_homepage("https://github.com/recp/cglm") + set_description("📽 Highly Optimized Graphics Math (glm) for C") + set_license("MIT") + + add_urls("https://github.com/recp/cglm/archive/refs/tags/$(version).tar.gz", + "https://github.com/recp/cglm.git") + add_versions("v0.9.0", "9b688bc52915cdd4ad8b7d4080ef59cc92674d526856d8f16bb3a114db1dd794") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + void test() { + mat4 projection; + glm_ortho(0.0f, 800, 600, 0.0f, -1.0f, 1.0f, projection); + } + ]]}, {includes = {"cglm/cglm.h"}})) + end)