xmake.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. package("boxfort")
  2. set_homepage("https://github.com/Snaipe/BoxFort")
  3. set_description("Convenient & cross-platform sandboxing C library")
  4. set_license("MIT")
  5. add_urls("https://github.com/Snaipe/BoxFort.git")
  6. add_versions("2024.05.02", "1018a44e63b57e9ffc3b8b68b6c8a8aa8f342d2a")
  7. add_configs("arena_reopen_shm", {description = "Reopen shared memory file in worker process rather than just inherit a file descriptor", default = false, type = "boolean"})
  8. add_configs("arena_file_backed", {description = "Use a file in tempfs to store the arena rather than using shm facilities", default = false, type = "boolean"})
  9. if is_plat("linux") then
  10. add_syslinks("rt", "m")
  11. end
  12. add_deps("meson", "ninja")
  13. on_install("windows|!arm64", "linux", "macosx", "bsd", "mingw", "msys", "cross", function (package)
  14. if not package:config("shared") then
  15. package:add("defines", "BXF_STATIC_LIB")
  16. end
  17. local configs = {"-Dsamples=false", "-Dtests=false"}
  18. table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
  19. table.insert(configs, "-Darena_reopen_shm=" .. (package:config("arena_reopen_shm") and "true" or "false"))
  20. table.insert(configs, "-Darena_reopen_shm=" .. (package:config("arena_reopen_shm") and "true" or "false"))
  21. import("package.tools.meson").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("bxf_arena_init", {includes = "boxfort.h"}))
  25. end)