xmake.lua 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. -- QWindowKit 库
  2. target("qwindowkit")
  3. set_kind("static")
  4. if is_plat("windows") then
  5. add_defines("UNICODE", "_UNICODE")
  6. end
  7. -- 源文件
  8. add_defines("QWK_CORE_STATIC","QWK_WIDGETS_STATIC", {public = true})
  9. -- 头文件
  10. add_includedirs("src/core")
  11. add_includedirs("src")
  12. add_files("src/core/contexts/abstractwindowcontext_p.h")
  13. add_files("src/core/contexts/cocoawindowcontext_p.h")
  14. add_files("src/core/contexts/qtwindowcontext_p.h")
  15. add_files("src/core/contexts/win32windowcontext_p.h")
  16. add_files("src/core/kernel/nativeeventfilter_p.h")
  17. add_files("src/core/kernel/sharedeventfilter_p.h")
  18. add_files("src/core/kernel/winidchangeeventfilter_p.h")
  19. -- # add_files("src/core/qwindowkit_linux.h")
  20. add_files("src/core/qwindowkit_windows.h")
  21. add_files("src/core/qwkglobal.h")
  22. add_files("src/core/qwkglobal_p.h")
  23. add_files("src/core/shared/qwkwindowsextra_p.h")
  24. add_files("src/core/shared/systemwindow_p.h")
  25. add_files("src/core/shared/windows10borderhandler_p.h")
  26. add_files("src/core/style/styleagent.h")
  27. add_files("src/core/style/styleagent_p.h")
  28. add_files("src/core/windowagentbase.h")
  29. add_files("src/core/windowagentbase_p.h")
  30. add_files("src/core/windowitemdelegate_p.h")
  31. add_files("src/widgets/qwkwidgetsglobal.h")
  32. add_files("src/widgets/widgetitemdelegate_p.h")
  33. add_files("src/widgets/widgetwindowagent.h")
  34. add_files("src/widgets/widgetwindowagent_p.h")
  35. add_files("src/core/contexts/abstractwindowcontext.cpp")
  36. --# add_files("src/core/contexts/cocoawindowcontext.mm")
  37. add_files("src/core/contexts/qtwindowcontext.cpp")
  38. add_files("src/core/contexts/win32windowcontext.cpp")
  39. add_files("src/core/kernel/nativeeventfilter.cpp")
  40. add_files("src/core/kernel/sharedeventfilter.cpp")
  41. add_files("src/core/kernel/winidchangeeventfilter.cpp")
  42. add_files("src/core/qwindowkit_windows.cpp")
  43. add_files("src/core/qwkglobal.cpp")
  44. add_files("src/core/style/styleagent.cpp")
  45. --# add_files("src/core/style/styleagent_linux.cpp")
  46. --# add_files("src/core/style/styleagent_mac.mm")
  47. add_files("src/core/style/styleagent_win.cpp")
  48. add_files("src/core/windowagentbase.cpp")
  49. add_files("src/core/windowitemdelegate.cpp")
  50. add_files("src/widgets/widgetitemdelegate.cpp")
  51. add_files("src/widgets/widgetwindowagent.cpp")
  52. --# add_files("src/widgets/widgetwindowagent_mac.cpp")
  53. add_files("src/widgets/widgetwindowagent_win.cpp")
  54. -- 包含目录
  55. add_includedirs("src", {public = true})
  56. -- Qt 配置
  57. add_rules("qt.static")
  58. -- Qt MOC 处理
  59. -- add_files("src/**/*.h", {rules = "qt.moc"})
  60. -- C++17 标准
  61. set_languages("c++17")
  62. -- Windows 特定配置
  63. if is_plat("windows") then
  64. add_cxflags("/utf-8")
  65. add_syslinks("user32", "gdi32", "ole32", "oleaut32")
  66. add_syslinks("dwmapi", "uxtheme", "shell32")
  67. else
  68. add_cxflags("-Wall", "-Wextra")
  69. end
  70. add_frameworks("QtCore", "QtGui", "QtWidgets")
  71. target_end()
  72. target("qwindowkit_widgets")
  73. add_rules("qt.static")
  74. if is_plat("windows") then
  75. add_defines("UNICODE", "_UNICODE")
  76. end
  77. add_includedirs("examples/shared", {public = true})
  78. add_files("examples/shared/widgetframe/windowbar.h")
  79. add_files("examples/shared/widgetframe/windowbar_p.h")
  80. add_files("examples/shared/widgetframe/windowbutton.h")
  81. add_files("examples/shared/widgetframe/windowbutton_p.h")
  82. add_files("examples/shared/widgetframe/windowbar.cpp")
  83. add_files("examples/shared/widgetframe/windowbutton.cpp")
  84. add_frameworks("QtCore", "QtGui", "QtWidgets")
  85. target_end()