-- Widgets 模块配置
-- 此文件被主项目通过 includes("widgets") 引入

-- Widgets 库
target("widgets_lib")
    add_rules("qt.static")
    if is_plat("windows") then
        add_defines("UNICODE", "_UNICODE")
    end
    
    -- 所有源文件
    add_files("chatView/*.cpp")
    add_files("chatView/chat1/*.cpp")
    add_files("*.cpp")
    add_headerfiles("*.h")
    
    -- 包含目录
    add_includedirs(".", {public = true})
    add_includedirs("..")
  
    add_deps("qwindowkit_widgets")
    add_deps("qwindowkit")
    -- Qt MOC 处理
    add_files("*.h", {rules = "qt.moc"})
    add_files("chatView/*.h", {rules = "qt.moc"})
    add_files("chatView/chat1/*.h", {rules = "qt.moc"})
    -- Windows 特定链接库
    if is_plat("windows") then
        add_syslinks("user32", "gdi32", "ole32", "shell32")
        add_syslinks("OpenGL32", "d3d11", "dwmapi")
    end
    add_frameworks("QtCore", "QtGui", "QtWidgets", "QtNetwork", "QtMultimedia", "QtWinExtras", "QtWebSockets")
target_end()
