Conditionally compile and link glad

Only include this library in the case that the OpenGL backend is
enabled.
This commit is contained in:
Wunkolo 2023-07-10 12:07:57 -07:00
parent 4864c51125
commit 0a605339a3

View file

@ -46,7 +46,7 @@ set(SDL_STATIC ON CACHE BOOL "" FORCE)
set(SDL_SHARED OFF CACHE BOOL "" FORCE)
set(SDL_TEST OFF CACHE BOOL "" FORCE)
add_subdirectory(third_party/SDL2)
add_subdirectory(third_party/glad)
add_subdirectory(third_party/toml11)
include_directories(${SDL2_INCLUDE_DIR})
include_directories(third_party/toml11)
@ -181,6 +181,8 @@ endif()
target_link_libraries(Alber PRIVATE dynarmic SDL2-static cryptopp)
if(PANDA3DS_ENABLE_OPENGL)
add_subdirectory(third_party/glad)
target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_OPENGL=1")
set(RENDERER_GL_INCLUDE_FILES include/opengl.hpp