workspace "gearlib"
    configurations { "Debug", "Release" }
    location "build"

    outputdir = "%{cfg.buildcfg}-%{cfg.system}"
    
    includes = { "include", "include/gearlib" }

    include "vendor/glfw"

project "gearlib"
    kind "StaticLib"
    language "C++"
    targetdir "bin/%{cfg.buildcfg}/gearlib"

    files { "include/**.h", "src/**.cpp", "src/**.c" }
    includedirs(includes)
    links { "GLFW" }

    filter "configurations:Debug"
        defines { "DEBUG" }
        symbols "On"

    filter "configurations:Release"
        defines { "NDEBUG" }
        optimize "On"

    filter "system:linux"
        links { "m" }

project "test"
    kind "ConsoleApp"
    language "C++"
    targetdir "bin/%{cfg.buildcfg}/test"

    files { "examples/test.cpp" }
    includedirs(includes)
    links { "GLFW", "gearlib" }

    debugdir "examples"

    filter "configurations:Debug"
        defines { "DEBUG" }
        symbols "On"

    filter "configurations:Release"
        defines { "NDEBUG" }
        optimize "On"

    filter "system:linux"
        links { "m" }
