xmake.lua 1009 B

123456789101112131415161718192021222324252627282930313233
  1. -- Widgets 模块配置
  2. -- 此文件被主项目通过 includes("widgets") 引入
  3. -- Widgets 库
  4. target("widgets_lib")
  5. add_rules("qt.static")
  6. if is_plat("windows") then
  7. add_defines("UNICODE", "_UNICODE")
  8. end
  9. -- 所有源文件
  10. add_files("chatView/*.cpp")
  11. add_files("chatView/chat1/*.cpp")
  12. add_files("*.cpp")
  13. add_headerfiles("*.h")
  14. -- 包含目录
  15. add_includedirs(".", {public = true})
  16. add_includedirs("..")
  17. add_deps("qwindowkit_widgets")
  18. add_deps("qwindowkit")
  19. -- Qt MOC 处理
  20. add_files("*.h", {rules = "qt.moc"})
  21. add_files("chatView/*.h", {rules = "qt.moc"})
  22. add_files("chatView/chat1/*.h", {rules = "qt.moc"})
  23. -- Windows 特定链接库
  24. if is_plat("windows") then
  25. add_syslinks("user32", "gdi32", "ole32", "shell32")
  26. add_syslinks("OpenGL32", "d3d11", "dwmapi")
  27. end
  28. add_frameworks("QtCore", "QtGui", "QtWidgets", "QtNetwork", "QtMultimedia", "QtWinExtras", "QtWebSockets")
  29. target_end()