local m = {}

local scriptdir = path.getabsolute(path.getdirectory(_SCRIPT))
local sfml = require("../vendor/sfml/build-sfml")
local imguisfml = require("../vendor/imgui-sfml/build-imgui-sfml")

function m.generateproject(bindir, intdir)
project "snake"
    language "C++"
    cppdialect "C++20"
    systemversion "latest"
    kind "WindowedApp"
    targetname "snake"
    targetdir (bindir)
    debugdir (scriptdir)
    objdir (intdir)

    -- link order matters on GCC/Clang
    imguisfml.link()
    sfml.link()

    includedirs
    {
        path.join(scriptdir, "src"),
        path.join(scriptdir, "include"),
    }

    files
    {
        path.join(scriptdir, "src/**.cpp"),
        path.join(scriptdir, "include/**.h"),
        path.join(scriptdir, "include/**.hpp"),
    }

    --windows specific settings--
    filter{"system:windows"}
    defines {"PLATFORM_WINDOWS"}

    filter {"system:windows", "configurations:debug"}
    defines{"_DEBUG", "_CONSOLE"}

    filter {"system:windows", "configurations:release"}
    defines{"NDEBUG"}

    --linux specific settings--
    filter {"system:linux"}
    defines {"PLATFORM_LINUX"}

end

return m