xmake.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.5", "3fac0f2cfc92b3f2c806e6743236467d0f691e54b1747a3955b82ef28b13e2fa")
  8. if is_plat("mingw") then
  9. add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true})
  10. end
  11. add_deps("imgui")
  12. if is_plat("windows") then
  13. add_deps("dirent")
  14. end
  15. on_install("windows", "linux", "macosx", "mingw", "android", function (package)
  16. local configs = {}
  17. io.writefile("xmake.lua", [[
  18. add_requires("imgui")
  19. if is_plat("windows") then
  20. add_requires("dirent")
  21. add_packages("dirent")
  22. end
  23. add_rules("mode.debug", "mode.release")
  24. target("imgui-file-dialog")
  25. set_kind("$(kind)")
  26. set_languages("c++11")
  27. add_files("ImGuiFileDialog.cpp")
  28. add_headerfiles("ImGuiFileDialog.h", "ImGuiFileDialogConfig.h")
  29. add_packages("imgui")
  30. if is_plat("windows") and is_kind("shared") then
  31. add_rules("utils.symbols.export_all", {export_classes = true})
  32. end
  33. ]])
  34. import("package.tools.xmake").install(package, configs)
  35. end)
  36. on_test(function (package)
  37. assert(package:check_cxxsnippets({test = [[
  38. #include <ImGuiFileDialog.h>
  39. void test() {
  40. ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose File", ".cpp,.h,.hpp", ".");
  41. }
  42. ]]}, {configs = {languages = "c++11"}}))
  43. end)