xmake.lua 1.0 KB

123456789101112131415161718192021222324252627282930
  1. package("qt6core")
  2. set_base("qt6lib")
  3. set_kind("library")
  4. on_load(function (package)
  5. package:data_set("libname", "Core")
  6. if package:is_plat("android") then
  7. package:data_set("syslinks", "z")
  8. elseif package:is_plat("iphoneos") then
  9. package:data_set("frameworks", {"UIKit", "CoreText", "CoreGraphics", "CoreServices", "CoreFoundation"})
  10. package:data_set("syslinks", "z")
  11. end
  12. package:base():script("load")(package)
  13. end)
  14. on_test(function (package)
  15. local cxflags
  16. if package:is_plat("windows") then
  17. cxflags = {"/Zc:__cplusplus", "/permissive-"}
  18. else
  19. cxflags = "-fPIC"
  20. end
  21. assert(package:check_cxxsnippets({test = [[
  22. int test(int argc, char** argv) {
  23. QCoreApplication app (argc, argv);
  24. return app.exec();
  25. }
  26. ]]}, {configs = {languages = "c++17", cxflags = cxflags}, includes = {"QCoreApplication"}}))
  27. end)