workspace "roguelike"
    configurations { "debug", "release" }
    platforms { "linux", "windows" }
    location "."

project "roguelike"
    kind "WindowedApp"
    language "C++"
    cppdialect "C++20"
    location "build/"
    buildinputs "../resources/**.*"
    buildoutputs "%{cfg.targetdir}/resources/**.*"
    files { "src/**.cpp", "vendor/**.cpp" }
    targetdir "bin/"
    exceptionhandling "Off"
    includedirs { "src/", "libs/SDL2/include/", "libs/SDL2_image/include/", "libs/SDL2/include/SDL2/" }
    filter "configurations:debug"
        defines { "DEBUG" }
        optimize "Off"
        symbols "On"
    filter "configurations:release"
        defines { "NDEBUG" }
        optimize "On"
        symbols "Off"
    filter "platforms:linux"
        postbuildcommands { "{COPYDIR} ../resources %{cfg.targetdir}" }
        includedirs { "src/", "vendor/" }
        links { "SDL2", "SDL2_image", "m" }
    filter "platforms:windows"
        libdirs { "libs/SDL2/lib/", "libs/SDL2/bin/", "libs/SDL2_image/lib/", "libs/SDL2_image/bin/" }
        links { "stdc++:static", "gcc:static", "winpthread:static", "mingw32:static", "SDL2main", "SDL2_image", "SDL2" }
        buildoptions { "-mwindows", "-static-libgcc", "-static-libstdc++" }
        prebuildcommands { "{COPY} ../libs/SDL2_image/bin/SDL2_image.dll %{cfg.targetdir}", "{COPY} ../libs/SDL2/bin/SDL2.dll %{cfg.targetdir}", "{COPY} ../libs/SDL2/lib/libSDL2main.a %{cfg.targetdir}" }
        postbuildcommands { "{COPYDIR} ../resources %{cfg.targetdir}" }
