2
0

xmake.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package("imgui-file-dialog")
  2. set_homepage("https://github.com/aiekick/ImGuiFileDialog")
  3. set_description("File Dialog for Dear ImGui")
  4. set_license("MIT")
  5. add_urls("https://github.com/aiekick/ImGuiFileDialog/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/aiekick/ImGuiFileDialog.git")
  7. add_versions("v0.6.7", "136e714965afaec2bac857bf46a653fdd74a0bf493e281682706c604113026b8")
  8. add_versions("v0.6.6", "75420f6eaf74fb1fa22042713f573858d8549366e7741baaf91128eb065b4b47")
  9. add_versions("v0.6.5", "3fac0f2cfc92b3f2c806e6743236467d0f691e54b1747a3955b82ef28b13e2fa")
  10. if is_plat("mingw") then
  11. add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true})
  12. end
  13. add_deps("imgui")
  14. if is_plat("windows") then
  15. add_deps("dirent")
  16. end
  17. on_install("windows", "linux", "macosx", "mingw", "android", function (package)
  18. local configs = {}
  19. io.writefile("xmake.lua", [[
  20. add_requires("imgui")
  21. if is_plat("windows") then
  22. add_requires("dirent")
  23. add_packages("dirent")
  24. end
  25. add_rules("mode.debug", "mode.release")
  26. target("imgui-file-dialog")
  27. set_kind("$(kind)")
  28. set_languages("c++11")
  29. add_files("ImGuiFileDialog.cpp")
  30. add_headerfiles("ImGuiFileDialog.h", "ImGuiFileDialogConfig.h")
  31. add_packages("imgui")
  32. if is_plat("windows") and is_kind("shared") then
  33. add_rules("utils.symbols.export_all", {export_classes = true})
  34. end
  35. ]])
  36. import("package.tools.xmake").install(package, configs)
  37. end)
  38. on_test(function (package)
  39. assert(package:check_cxxsnippets({test = [[
  40. #include <ImGuiFileDialog.h>
  41. void test() {
  42. ImGuiFileDialog::Instance()->Close();
  43. }
  44. ]]}, {configs = {languages = "c++11"}}))
  45. end)