local includes = { "include", "include/gearlib" }

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

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

    files { "include/gearlib/GLFW/**.h", "vendor/glfw/src/**.c" }
    includedirs(includes)

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

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

    filter "system:linux"
        defines { "_GLFW_X11" }

    filter "system:windows"
        defines { "_GLFW_WIN32" }

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

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

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

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

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

    files { "examples/test.c" }
    includedirs(includes)
    links { "glfw", "gearlib", "m" }

    debugdir "examples"

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

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