2019-09-09 07:01:26 +00:00
|
|
|
set(SRCS
|
|
|
|
src/glad.c
|
|
|
|
)
|
|
|
|
|
2020-05-07 12:48:13 +00:00
|
|
|
# Linking as a static library breaks on macOS, see https://github.com/libigl/libigl/issues/751
|
|
|
|
if(APPLE)
|
|
|
|
add_library(glad OBJECT ${SRCS})
|
|
|
|
else()
|
|
|
|
add_library(glad ${SRCS})
|
|
|
|
endif()
|
|
|
|
|
2019-09-09 07:01:26 +00:00
|
|
|
target_include_directories(glad PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
|
|
target_include_directories(glad INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
2020-05-03 17:00:54 +00:00
|
|
|
target_link_libraries(glad PRIVATE Threads::Threads "${CMAKE_DL_LIBS}")
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
target_sources(glad PRIVATE src/glad_wgl.c)
|
|
|
|
else()
|
2023-09-17 02:51:00 +00:00
|
|
|
if(ENABLE_EGL)
|
2020-05-03 17:00:54 +00:00
|
|
|
target_sources(glad PRIVATE src/glad_egl.c)
|
|
|
|
target_link_libraries(glad PRIVATE EGL::EGL)
|
|
|
|
endif()
|
2023-09-17 02:51:00 +00:00
|
|
|
if(ENABLE_X11)
|
2020-05-03 17:00:54 +00:00
|
|
|
target_sources(glad PRIVATE src/glad_glx.c)
|
|
|
|
endif()
|
|
|
|
endif()
|