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

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