allow custom opengl loader

This commit is contained in:
2022-07-14 18:04:13 +02:00
parent 85eb9bbc32
commit 66376eaeda
4 changed files with 96 additions and 20 deletions

View File

@@ -1,6 +1,12 @@
add_rules("mode.debug", "mode.release")
--add_requires("SDL2", "glfw", "zlib", "glm")
if is_os("linux") then
GL_LOADER = "glad"
add_defines("TD_IMPL_OPENGL_LOADER_GLAD");
add_requires("libsdl >= 2", "zlib", GL_LOADER)
else
add_defines("TD_IMPL_OPENGL_LOADER_GLBINDING2");
end
target("TowerDefense")
set_kind("binary")
@@ -8,15 +14,14 @@ target("TowerDefense")
add_files("src/*.cpp", "src/*/*.cpp", "src/*/*/*.cpp", "src/*/*/*/*.cpp")
add_cxflags("-pthread")
add_links("pthread")
set_languages("c++17")
add_links("glbinding", "z", "SDL2")
if is_os("linux") then
add_links("GL", "pthread")
end
if is_os("windows") then
add_links("opengl32", "ws2_32", "mingw32", "gdi32", "imm32")
add_links("opengl32", "ws2_32", "mingw32", "gdi32", "imm32", "z", "SDL2", "glbinding")
else
add_packages("zlib", "libsdl", GL_LOADER, "opengl")
end
if is_mode("release") then