xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("marchingcubecpp")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/aparis69/marchingcubecpp")
  4. set_description("A public domain/MIT header-only marching cube implementation in C++ without anything fancy.")
  5. set_license("MIT")
  6. add_urls("https://github.com/aparis69/marchingcubecpp.git")
  7. add_versions("2023.09.12", "f03a1b3ec29b1d7d865691ca8aea4f1eb2c2873d")
  8. on_install(function (package)
  9. io.replace("MC.h", "#include <cmath>", "#include <cmath>\n#include <cstdint>", {plain = true})
  10. os.cp("*.h", package:installdir("include"))
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({test = [[
  14. void test() {
  15. // First compute a scalar field
  16. const int n = 100;
  17. MC::MC_FLOAT* field = new MC::MC_FLOAT[n * n * n];
  18. // [...]
  19. // Compute isosurface using marching cube
  20. MC::mcMesh mesh;
  21. MC::marching_cube(field, n, n, n, mesh);
  22. }
  23. ]]}, {configs = {languages = "c++14"}, includes = "MC.h"}))
  24. end)