xmake.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.8", "7aa3fbb0fc7206c5b434246d906f036057a59eb51e28ae36488aa654a667a266")
  8. add_versions("v0.6.7", "136e714965afaec2bac857bf46a653fdd74a0bf493e281682706c604113026b8")
  9. add_versions("v0.6.6", "75420f6eaf74fb1fa22042713f573858d8549366e7741baaf91128eb065b4b47")
  10. add_versions("v0.6.5", "3fac0f2cfc92b3f2c806e6743236467d0f691e54b1747a3955b82ef28b13e2fa")
  11. if is_plat("mingw") then
  12. add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true})
  13. end
  14. add_deps("imgui")
  15. if is_plat("windows") then
  16. add_deps("dirent")
  17. end
  18. on_check("mingw|i386", function (package)
  19. if package:version() and package:version():ge("0.6.8") then
  20. raise("package(imgui-file-dialog >=0.6.8) does not support i386 mingw build")
  21. end
  22. end)
  23. on_install("!iphoneos", function (package)
  24. local configs = {}
  25. io.writefile("xmake.lua", [[
  26. add_requires("imgui")
  27. if is_plat("windows") then
  28. add_requires("dirent")
  29. add_packages("dirent")
  30. end
  31. add_rules("mode.debug", "mode.release")
  32. target("imgui-file-dialog")
  33. set_kind("$(kind)")
  34. set_languages("c++11")
  35. add_files("ImGuiFileDialog.cpp")
  36. add_headerfiles("ImGuiFileDialog.h", "ImGuiFileDialogConfig.h")
  37. add_packages("imgui")
  38. if is_plat("windows") and is_kind("shared") then
  39. add_rules("utils.symbols.export_all", {export_classes = true})
  40. end
  41. ]])
  42. import("package.tools.xmake").install(package, configs)
  43. end)
  44. on_test(function (package)
  45. assert(package:check_cxxsnippets({test = [[
  46. #include <ImGuiFileDialog.h>
  47. void test() {
  48. ImGuiFileDialog::Instance()->Close();
  49. }
  50. ]]}, {configs = {languages = "c++11"}}))
  51. end)