xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.15", "3df87e67a1e28db86828059363d78972a298cd403ba1f5780c1040e03dfa2672")
  8. add_deps("imgui")
  9. on_install("windows", "linux", "macosx", "mingw", "android", "iphoneos", function (package)
  10. local configs = {}
  11. io.writefile("xmake.lua", [[
  12. add_requires("imgui")
  13. add_rules("mode.release", "mode.debug")
  14. target("implot")
  15. set_kind("$(kind)")
  16. set_languages("c++11")
  17. add_files("*.cpp|implot_demo.cpp")
  18. add_headerfiles("*.h")
  19. add_packages("imgui")
  20. if is_plat("windows") and is_kind("shared") then
  21. add_rules("utils.symbols.export_all", {export_classes = true})
  22. end
  23. ]])
  24. if package:config("shared") then
  25. configs.kind = "shared"
  26. end
  27. import("package.tools.xmake").install(package, configs)
  28. end)
  29. on_test(function (package)
  30. assert(package:check_cxxsnippets({test = [[
  31. #include <implot.h>
  32. void test() {
  33. ImPlot::CreateContext();
  34. ImPlot::DestroyContext();
  35. }
  36. ]]}, {configs = {languages = "c++11"}}))
  37. end)