Externals: Add libepoxy submodule.
This commit is contained in:
parent
e7d2118858
commit
f5f06a592a
4 changed files with 52 additions and 0 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -7,3 +7,6 @@
|
||||||
[submodule "externals/nihstro"]
|
[submodule "externals/nihstro"]
|
||||||
path = externals/nihstro
|
path = externals/nihstro
|
||||||
url = https://github.com/neobrain/nihstro.git
|
url = https://github.com/neobrain/nihstro.git
|
||||||
|
[submodule "externals/libepoxy/libepoxy"]
|
||||||
|
path = externals/libepoxy/libepoxy
|
||||||
|
url = https://github.com/anholt/libepoxy.git
|
||||||
|
|
|
@ -34,6 +34,8 @@ else()
|
||||||
endif()
|
endif()
|
||||||
add_definitions(-DSINGLETHREADED)
|
add_definitions(-DSINGLETHREADED)
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
|
||||||
find_package(PNG QUIET)
|
find_package(PNG QUIET)
|
||||||
if (PNG_FOUND)
|
if (PNG_FOUND)
|
||||||
add_definitions(-DHAVE_PNG)
|
add_definitions(-DHAVE_PNG)
|
||||||
|
@ -55,6 +57,16 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules")
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
|
|
||||||
|
pkg_search_module(LIBEPOXY epoxy)
|
||||||
|
if(LIBEPOXY_FOUND)
|
||||||
|
message("Using shared libepoxy")
|
||||||
|
else()
|
||||||
|
message("Using static libepoxy from externals")
|
||||||
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/externals/libepoxy)
|
||||||
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/externals/libepoxy/include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/externals/libepoxy/libepoxy/include)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(ENABLE_GLFW "Enable the GLFW frontend" ON)
|
option(ENABLE_GLFW "Enable the GLFW frontend" ON)
|
||||||
if (ENABLE_GLFW)
|
if (ENABLE_GLFW)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
36
externals/libepoxy/CMakeLists.txt
vendored
Normal file
36
externals/libepoxy/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
|
||||||
|
project(libepoxy)
|
||||||
|
|
||||||
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||||
|
add_definitions(-std=c99)
|
||||||
|
|
||||||
|
set(top_srcdir ${CMAKE_CURRENT_SOURCE_DIR}/libepoxy)
|
||||||
|
set(top_builddir ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
set(srcdir ${top_srcdir}/src)
|
||||||
|
set(builddir ${top_builddir}/src)
|
||||||
|
|
||||||
|
make_directory(${top_builddir}/include/epoxy)
|
||||||
|
make_directory(${top_builddir}/src)
|
||||||
|
|
||||||
|
foreach(REGISTRY gl egl glx wgl)
|
||||||
|
execute_process(COMMAND python3 ${srcdir}/gen_dispatch.py --dir ${top_builddir} ${top_srcdir}/registry/${REGISTRY}.xml)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
include_directories(${top_srcdir}/include)
|
||||||
|
|
||||||
|
set(SRCS ${srcdir}/dispatch_common.c ${builddir}/gl_generated_dispatch.c)
|
||||||
|
|
||||||
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
if (WIN32)
|
||||||
|
set(SRCS ${SRCS} ${srcdir}/dispatch_wgl.c ${builddir}/wgl_generated_dispatch.c)
|
||||||
|
elseif (NOT APPLE)
|
||||||
|
find_package(X11)
|
||||||
|
if (NOT X11_FOUND)
|
||||||
|
set(SRCS ${SRCS} ${srcdir}/dispatch_glx.c ${builddir}/glx_generated_dispatch.c)
|
||||||
|
endif()
|
||||||
|
set(SRCS ${SRCS} ${srcdir}/dispatch_egl.c ${builddir}/egl_generated_dispatch.c)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(epoxy STATIC ${SRCS})
|
1
externals/libepoxy/libepoxy
vendored
Submodule
1
externals/libepoxy/libepoxy
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 20062c25e7612cab023cdef44d3277ba1bd0b2de
|
Loading…
Reference in a new issue