
add_requires("libsdl2", {configs = {shared = true,wayland = true}})
add_requires("libsdl2_image")
add_requires("libsdl2_mixer")
add_requires("glm")
add_requires("zlib")
add_requires("squirrel")

target("Frostbite2D")
    set_kind("binary")
    add_files(path.join(os.projectdir(), "Frostbite2D/src/**.cpp"))
    add_files(path.join(os.projectdir(), "Frostbite2D/src/**.c"))
    add_includedirs(path.join(os.projectdir(), "Frostbite2D/include"))

    add_files(path.join(os.projectdir(), "Game/src/**.cpp"))
    add_includedirs(path.join(os.projectdir(), "Game/include"))

    add_packages("libsdl2")
    add_packages("libsdl2_image")
    add_packages("libsdl2_mixer")
    add_packages("glm")
    add_packages("zlib")
    add_packages("squirrel")

    -- 复制着色器文件到输出目录
    after_build(function (target)
        -- 复制 assets 目录
        local assets_dir = path.join(os.projectdir(), "Game/assets")
        local output_dir = target:targetdir()
        local target_assets_dir = path.join(output_dir, "assets")

        if os.isdir(assets_dir) then
            os.rm(target_assets_dir)
            os.cp(assets_dir, output_dir)
            print("Copy assets directory: " .. assets_dir .. " -> " .. target_assets_dir)
        end
    end)
target_end()
