xmake.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package("fluxent")
  2. set_homepage("https://github.com/Project-Xent/fluxent")
  3. set_description("A lightweight Windows UI framework in modern C++.")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/Project-Xent/fluxent.git")
  6. add_versions("2026.01.30", "6bf7e68893aaabe0d389e58cb2f5711e5e76aadb")
  7. add_deps("xent-core", "tl_expected")
  8. on_install("windows", function (package)
  9. io.replace("include/fluxent/types.hpp", [[#include "../../third_party/tl/expected.hpp"]], [[#include <tl/expected.hpp>]], {plain = true})
  10. io.writefile("xmake.lua", [[
  11. add_rules("mode.debug", "mode.release")
  12. set_languages("c++20")
  13. add_defines("_WIN32_WINNT=0x0A00", "WINVER=0x0A00", "UNICODE", "_UNICODE", "WIN32_LEAN_AND_MEAN", "NOMINMAX")
  14. add_requires("xent-core", "tl_expected")
  15. target("fluxent")
  16. set_kind("$(kind)")
  17. add_includedirs("include")
  18. add_headerfiles("include/fluxent/(**.hpp)", {prefixdir = "fluxent"})
  19. add_packages("xent-core", "tl_expected")
  20. add_files("src/*.cpp", "src/theme/*.cpp", "src/controls/*.cpp")
  21. if is_plat("windows", "mingw") then
  22. add_syslinks("user32", "gdi32", "dcomp", "d2d1", "d3d11", "dxgi", "dwrite", "dwmapi", "ole32", "uuid", "uxtheme")
  23. end
  24. if is_plat("windows") and is_kind("shared") then
  25. add_rules("utils.symbols.export_all", {export_classes = true})
  26. end
  27. ]])
  28. import("package.tools.xmake").install(package)
  29. end)
  30. on_test(function (package)
  31. assert(package:check_cxxsnippets({test = [[
  32. #include <fluxent/fluxent.hpp>
  33. using namespace fluxent;
  34. void test() {
  35. fluxent::WindowConfig config;
  36. config.title = L"Hello FluXent";
  37. config.width = 400;
  38. config.height = 600;
  39. config.backdrop = fluxent::BackdropType::Mica;
  40. fluxent::theme::ThemeManager theme_manager;
  41. auto window_res = fluxent::Window::Create(&theme_manager, config);
  42. }
  43. ]]}, {configs = {languages = "c++20"}}))
  44. end)