2
0

xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("libfixmatrix")
  2. set_homepage("https://github.com/PetteriAimonen/libfixmatrix")
  3. set_description("C library for fixed point matrix, quaternion and vector calculations")
  4. set_license("MIT")
  5. add_urls("https://github.com/PetteriAimonen/libfixmatrix.git")
  6. add_versions("2014.01.17", "a8d583e4fe1fa27ba2e0ec55970f73a1b1e6928b")
  7. add_deps("libfixmath")
  8. on_install(function (package)
  9. for _, file in ipairs(os.files("*.h")) do
  10. io.replace(file, "fix16.h", "libfixmath/fix16.h", {plain = true})
  11. end
  12. io.writefile("xmake.lua", [[
  13. add_rules("mode.debug", "mode.release")
  14. add_requires("libfixmath")
  15. set_languages("c++11")
  16. target("fixmatrix")
  17. set_kind("$(kind)")
  18. add_files("*.c|*_unittests.c")
  19. add_headerfiles("*.h|unittests.h", {prefixdir = "libfixmatrix"})
  20. if is_plat("windows") and is_kind("shared") then
  21. add_rules("utils.symbols.export_all")
  22. end
  23. add_packages("libfixmath")
  24. ]])
  25. import("package.tools.xmake").install(package)
  26. end)
  27. on_test(function (package)
  28. assert(package:has_cfuncs("mf16_fill", {includes = "libfixmatrix/fixmatrix.h"}))
  29. end)