xmake.lua 2.2 KB

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