libfixmatrix: add package (#5347)
parent
22625ba5b6
commit
0572fb0b72
2 changed files with 62 additions and 0 deletions
@ -0,0 +1,27 @@ |
||||
package("libfixmath") |
||||
set_homepage("https://code.google.com/p/libfixmath/") |
||||
set_description("Cross Platform Fixed Point Maths Library") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/PetteriAimonen/libfixmath.git") |
||||
|
||||
add_versions("2023.08.06", "d308e466e1a09118d03f677c52e5fbf402f6fdd0") |
||||
|
||||
on_install(function (package) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
set_languages("c++11") |
||||
target("fixmath") |
||||
set_kind("$(kind)") |
||||
add_files("libfixmath/*.c") |
||||
add_headerfiles("(libfixmath/*.h)", "(libfixmath/*.hpp)") |
||||
if is_plat("windows") and is_kind("shared") then |
||||
add_rules("utils.symbols.export_all") |
||||
end |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("uint32_log2", {includes = "libfixmath/uint32.h"})) |
||||
end) |
@ -0,0 +1,35 @@ |
||||
package("libfixmatrix") |
||||
set_homepage("https://github.com/PetteriAimonen/libfixmatrix") |
||||
set_description("C library for fixed point matrix, quaternion and vector calculations") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/PetteriAimonen/libfixmatrix.git") |
||||
|
||||
add_versions("2014.01.17", "a8d583e4fe1fa27ba2e0ec55970f73a1b1e6928b") |
||||
|
||||
add_deps("libfixmath") |
||||
|
||||
on_install(function (package) |
||||
for _, file in ipairs(os.files("*.h")) do |
||||
io.replace(file, "fix16.h", "libfixmath/fix16.h", {plain = true}) |
||||
end |
||||
|
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
add_requires("libfixmath") |
||||
set_languages("c++11") |
||||
target("fixmatrix") |
||||
set_kind("$(kind)") |
||||
add_files("*.c|*_unittests.c") |
||||
add_headerfiles("*.h|unittests.h", {prefixdir = "libfixmatrix"}) |
||||
if is_plat("windows") and is_kind("shared") then |
||||
add_rules("utils.symbols.export_all") |
||||
end |
||||
add_packages("libfixmath") |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("mf16_fill", {includes = "libfixmatrix/fixmatrix.h"})) |
||||
end) |
Loading…
Reference in new issue