xmake.lua 964 B

123456789101112131415161718192021222324
  1. package("linalg")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/sgorsten/linalg")
  4. set_description("linalg.h is a single header, public domain, short vector math library for C++.")
  5. set_license("Unlicense license")
  6. add_urls("https://github.com/sgorsten/linalg/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/sgorsten/linalg.git")
  8. add_versions("v2.2", "28640228988186EDAF7729177BFAB4C91170B303AD489407A4228CEB55A73EC2")
  9. on_install("windows", "linux", "macosx", function (package)
  10. os.cp("linalg.h", package:installdir("include"))
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. using namespace linalg::aliases;
  15. float4 test(float3 a, float3 b, float3 c) {
  16. float3 n = cross(b-a, c-a);
  17. return {n, -dot(n,a)};
  18. }
  19. ]]}, {configs = {languages = "c++11"}, includes = "linalg.h"}))
  20. end)