xmake.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package("implot")
  2. set_homepage("https://github.com/epezent/implot")
  3. set_description("Immediate Mode Plotting")
  4. set_license("MIT")
  5. add_urls("https://github.com/epezent/implot/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/epezent/implot.git")
  7. add_versions("v0.16", "961df327d8a756304d1b0a67316eebdb1111d13d559f0d3415114ec0eb30abd1")
  8. add_versions("v0.15", "3df87e67a1e28db86828059363d78972a298cd403ba1f5780c1040e03dfa2672")
  9. add_deps("imgui")
  10. on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", function (package)
  11. local configs = {}
  12. io.writefile("xmake.lua", [[
  13. add_requires("imgui")
  14. add_rules("mode.release", "mode.debug")
  15. target("implot")
  16. set_kind("$(kind)")
  17. set_languages("c++11")
  18. add_files("*.cpp|implot_demo.cpp")
  19. add_headerfiles("*.h")
  20. add_packages("imgui")
  21. if is_plat("windows") and is_kind("shared") then
  22. add_rules("utils.symbols.export_all", {export_classes = true})
  23. end
  24. ]])
  25. if package:config("shared") then
  26. configs.kind = "shared"
  27. end
  28. import("package.tools.xmake").install(package, configs)
  29. end)
  30. on_test(function (package)
  31. assert(package:check_cxxsnippets({test = [[
  32. #include <implot.h>
  33. void test() {
  34. ImPlot::CreateContext();
  35. ImPlot::DestroyContext();
  36. }
  37. ]]}, {configs = {languages = "c++11"}}))
  38. end)