Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update bvh #4597

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions packages/b/bvh/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
package("bvh")

set_kind("library", {headeronly = true})
set_homepage("https://github.com/madmann91/bvh")
set_description("A modern C++ BVH construction and traversal library")
set_license("MIT")

add_urls("https://github.com/madmann91/bvh.git")
add_versions("2023.6.30", "578b1e8035743d0a97fcac802de81622c54f28e3")
add_versions("2024.7.8", "77a08cac234bae46abbb5e78c73e8f3c158051d0")

on_install(function (package)
if not package:is_plat("cross") then
package:add("cxxflags", "-march=native")
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
add_configs("c_api", {description = "Builds the C API library wrapper", default = true, type = "boolean"})

if is_plat("bsd") then
add_syslinks("pthread")
end
on_load(function (package)
if not package:config("c_api") then
package:set("kind", "library", {headeronly = true})
end
end)

on_install(function (package)
os.cp("src/bvh", package:installdir("include"))
if package:config("c_api") then
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
set_languages("c++20")
target("bvh_c")
set_kind("shared")
add_defines("BVH_BUILD_API")
add_files("src/bvh/v2/c_api/bvh.cpp")
add_includedirs("src")
]])
import("package.tools.xmake").install(package)
end
end)

on_test(function (package)
Expand Down
Loading