xmake.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. -- AvRecorder 模块配置
  2. -- 此文件被主项目通过 includes("AvRecorder") 引入
  3. -- 包含子模块
  4. includes("capturer")
  5. -- AvRecorder 主库
  6. target("avrecorder_lib")
  7. -- Qt 配置
  8. add_rules("qt.static")
  9. if is_plat("windows") then
  10. add_defines("UNICODE", "_UNICODE")
  11. end
  12. -- Qt MOC 处理
  13. add_files("ui/*.h")
  14. add_files("capturer/audio/*.h")
  15. add_files("*.h")
  16. -- 根目录源文件
  17. add_files("*.cpp")
  18. add_headerfiles("*.h")
  19. -- 基础模块源文件
  20. add_files("basic/*.cpp")
  21. add_headerfiles("basic/*.h")
  22. -- D3D 模块源文件
  23. add_files("d3d/*.cpp")
  24. add_headerfiles("d3d/*.h")
  25. -- 编码器模块源文件
  26. add_files("encoder/*.cpp")
  27. add_headerfiles("encoder/*.h")
  28. -- 混流器模块源文件
  29. add_files("muxer/*.cpp")
  30. add_headerfiles("muxer/*.h")
  31. -- 录制器模块源文件
  32. add_files("recorder/*.cpp")
  33. add_headerfiles("recorder/*.h")
  34. -- UI 模块源文件
  35. add_files("ui/*.cpp")
  36. add_headerfiles("ui/*.h")
  37. -- 包含目录
  38. add_includedirs(".", { public = true })
  39. add_includedirs("basic", { public = true })
  40. add_includedirs("d3d", { public = true })
  41. add_includedirs("encoder", { public = true })
  42. add_includedirs("muxer", { public = true })
  43. add_includedirs("recorder", { public = true })
  44. add_includedirs("ui", { public = true })
  45. -- 依赖的子模块
  46. add_deps("capturer_lib", { public = true })
  47. -- add_deps("av_framework") -- 暂时不使用AV模块
  48. -- FFmpeg 配置
  49. add_ffmpeg_config()
  50. -- Windows 特定链接库
  51. if is_plat("windows") then
  52. add_syslinks("d3d11", "dxgi", "user32", "gdi32")
  53. add_syslinks("winmm", "ole32", "oleaut32")
  54. end
  55. add_frameworks("QtCore", "QtGui", "QtWidgets", "QtNetwork", "QtMultimedia")
  56. target_end()
  57. -- AvRecorder 主程序(如果需要独立运行)
  58. target("AvRecorder")
  59. add_rules("qt.widgetapp")
  60. set_kind("binary")
  61. if is_plat("windows") then
  62. add_defines("UNICODE", "_UNICODE")
  63. end
  64. -- 设置输出目录
  65. set_targetdir("$(projectdir)/bin")
  66. if is_mode("debug") then
  67. set_targetdir("$(projectdir)/bin_debug")
  68. set_basename("AvRecorderd")
  69. end
  70. -- 主程序源文件
  71. add_files("main.cpp")
  72. -- 依赖库
  73. add_deps("avrecorder_lib")
  74. -- add_deps("av_framework") -- 暂时不使用AV模块
  75. -- Qt 配置
  76. add_qt_config()
  77. -- FFmpeg 配置
  78. add_ffmpeg_config()
  79. -- Windows 特定链接库
  80. if is_plat("windows") then
  81. add_syslinks("shell32", "user32", "gdi32", "ole32", "oleaut32")
  82. add_syslinks("winmm", "d3d11", "dwmapi", "windowsapp")
  83. add_syslinks("OpenGL32")
  84. end
  85. add_frameworks("QtCore", "QtGui", "QtWidgets", "QtNetwork", "QtMultimedia")
  86. target_end()