From 003bfbf56d434602c73cf5586de46d8ca54fa498 Mon Sep 17 00:00:00 2001 From: Zheng Zeng Date: Wed, 31 Jan 2024 14:50:13 -0800 Subject: [PATCH] Add linalg (#3202) * Add linalg * Remove comment; update sha256. * Update xmake.lua * Update xmake.lua --------- Co-authored-by: ruki --- packages/l/linalg/xmake.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/l/linalg/xmake.lua diff --git a/packages/l/linalg/xmake.lua b/packages/l/linalg/xmake.lua new file mode 100644 index 000000000..b0512c4df --- /dev/null +++ b/packages/l/linalg/xmake.lua @@ -0,0 +1,24 @@ +package("linalg") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/sgorsten/linalg") + set_description("linalg.h is a single header, public domain, short vector math library for C++.") + set_license("Unlicense license") + + add_urls("https://github.com/sgorsten/linalg/archive/refs/tags/$(version).tar.gz", + "https://github.com/sgorsten/linalg.git") + + add_versions("v2.2", "28640228988186EDAF7729177BFAB4C91170B303AD489407A4228CEB55A73EC2") + + on_install("windows", "linux", "macosx", function (package) + os.cp("linalg.h", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + using namespace linalg::aliases; + float4 test(float3 a, float3 b, float3 c) { + float3 n = cross(b-a, c-a); + return {n, -dot(n,a)}; + } + ]]}, {configs = {languages = "c++11"}, includes = "linalg.h"})) + end)