Fixing Linux build

This commit is contained in:
Bradley Austin Davis 2018-01-15 09:09:30 -08:00
parent 537db9acb3
commit bac3388693

View file

@ -15,22 +15,16 @@ macro(TARGET_GLAD)
find_library(EGL EGL)
target_link_libraries(${TARGET_NAME} ${EGL})
else()
if (APPLE)
set(GLAD_VER "41")
if (USE_GLES)
set(GLAD_VER "32es")
else()
if (USE_GLES)
set(GLAD_VER "32es")
else()
set(GLAD_VER "45")
add_dependency_external_projects(glad45)
endif()
if (WIN32)
find_package(OpenGL REQUIRED)
target_link_libraries(${TARGET_NAME} "${OPENGL_LIBRARY}")
# we don't need the include, because we get everything from GLAD
#target_include_directories(${TARGET_NAME} PUBLIC ${OPENGL_INCLUDE_DIR})
endif()
set(GLAD_VER "45")
endif()
find_package(OpenGL REQUIRED)
list(APPEND GLAD_EXTRA_LIBRARIES ${OPENGL_LIBRARY})
if (NOT WIN32)
list(APPEND GLAD_EXTRA_LIBRARIES dl)
endif()
set(GLAD "glad${GLAD_VER}")
string(TOUPPER ${GLAD} GLAD_UPPER)
add_dependency_external_projects(${GLAD})
@ -40,4 +34,5 @@ macro(TARGET_GLAD)
target_include_directories(${TARGET_NAME} PUBLIC ${GLAD_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME} ${GLAD_LIBRARY})
target_link_libraries(${TARGET_NAME} ${GLAD_EXTRA_LIBRARIES})
endmacro()