local m = {}

local rootdir = path.join(path.getabsolute(path.getdirectory(_SCRIPT)), "../")

package.path = package.path .. ";../third-party/premake-scripts/?.lua"

local sfml = require("build-sfml")

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

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

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

    sfml.link()

    --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