mirror of https://github.com/libsdl-org/SDL.git
Just use the khronos headers for the checks that need them
This commit is contained in:
parent
4b82bed259
commit
5db543a66a
|
|
@ -448,7 +448,6 @@ if(USE_GCC OR USE_INTELCC OR (USE_CLANG AND NOT MSVC_CLANG))
|
||||||
else()
|
else()
|
||||||
sdl_include_directories(NO_EXPORT SYSTEM PUBLIC "$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src/video/khronos>")
|
sdl_include_directories(NO_EXPORT SYSTEM PUBLIC "$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src/video/khronos>")
|
||||||
endif()
|
endif()
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${SDL3_SOURCE_DIR}/src/video/khronos")
|
|
||||||
|
|
||||||
# General source files
|
# General source files
|
||||||
sdl_glob_sources(
|
sdl_glob_sources(
|
||||||
|
|
|
||||||
|
|
@ -652,6 +652,7 @@ macro(CheckEGL)
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
find_package(OpenGL MODULE)
|
find_package(OpenGL MODULE)
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENGL_EGL_INCLUDE_DIRS})
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENGL_EGL_INCLUDE_DIRS})
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${SDL3_SOURCE_DIR}/src/video/khronos")
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#define EGL_API_FB
|
#define EGL_API_FB
|
||||||
#define MESA_EGL_NO_X11_HEADERS
|
#define MESA_EGL_NO_X11_HEADERS
|
||||||
|
|
@ -686,18 +687,21 @@ endmacro()
|
||||||
# - nada
|
# - nada
|
||||||
macro(CheckOpenGLES)
|
macro(CheckOpenGLES)
|
||||||
if(SDL_OPENGLES)
|
if(SDL_OPENGLES)
|
||||||
|
cmake_push_check_state()
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${SDL3_SOURCE_DIR}/src/video/khronos")
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <GLES/gl.h>
|
#include <GLES/gl.h>
|
||||||
#include <GLES/glext.h>
|
#include <GLES/glext.h>
|
||||||
int main (int argc, char** argv) { return 0; }" HAVE_OPENGLES_V1)
|
int main (int argc, char** argv) { return 0; }" HAVE_OPENGLES_V1)
|
||||||
if(HAVE_OPENGLES_V1)
|
|
||||||
set(HAVE_OPENGLES TRUE)
|
|
||||||
set(SDL_VIDEO_OPENGL_ES 1)
|
|
||||||
endif()
|
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
#include <GLES2/gl2ext.h>
|
#include <GLES2/gl2ext.h>
|
||||||
int main (int argc, char** argv) { return 0; }" HAVE_OPENGLES_V2)
|
int main (int argc, char** argv) { return 0; }" HAVE_OPENGLES_V2)
|
||||||
|
cmake_pop_check_state()
|
||||||
|
if(HAVE_OPENGLES_V1)
|
||||||
|
set(HAVE_OPENGLES TRUE)
|
||||||
|
set(SDL_VIDEO_OPENGL_ES 1)
|
||||||
|
endif()
|
||||||
if(HAVE_OPENGLES_V2)
|
if(HAVE_OPENGLES_V2)
|
||||||
set(HAVE_OPENGLES TRUE)
|
set(HAVE_OPENGLES TRUE)
|
||||||
set(SDL_VIDEO_OPENGL_ES2 1)
|
set(SDL_VIDEO_OPENGL_ES2 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue