CMake: Move BUILD_GL flags to FEATURE_DEFINES

This commit is contained in:
Vicki Pfau 2020-11-25 21:16:30 -08:00
parent b169e6b0df
commit 2e2ad70550
1 changed files with 3 additions and 12 deletions

View File

@ -457,17 +457,20 @@ if(NOT BUILD_GLES2)
endif()
if(BUILD_GL)
list(APPEND FEATURE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/opengl/gl.c)
list(APPEND FEATURE_DEFINES BUILD_GL)
list(APPEND DEPENDENCY_LIB ${OPENGL_LIBRARY})
include_directories(${OPENGL_INCLUDE_DIR})
endif()
if(BUILD_GLES2)
list(APPEND FEATURE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/opengl/gles2.c)
list(APPEND FEATURE_DEFINES BUILD_GLES2)
list(APPEND DEPENDENCY_LIB ${OPENGLES2_LIBRARY})
include_directories(${OPENGLES2_INCLUDE_DIR})
endif()
if(BUILD_GLES3)
find_path(OPENGLES3_INCLUDE_DIR NAMES GLES3/gl3.h)
find_library(OPENGLES3_LIBRARY NAMES GLESv3 GLESv2)
list(APPEND FEATURE_DEFINES BUILD_GLES3)
if(NOT OPENGLES3_INCLUDE_DIR OR NOT OPENGLES3_LIBRARY)
set(BUILD_GLES3 OFF CACHE BOOL "OpenGL|ES 3 not found" FORCE)
endif()
@ -912,18 +915,6 @@ else()
endif()
endif()
if(BUILD_GL)
add_definitions(-DBUILD_GL)
endif()
if(BUILD_GLES2)
add_definitions(-DBUILD_GLES2)
endif()
if(BUILD_GLES3)
add_definitions(-DBUILD_GLES3)
endif()
if(DISABLE_FRONTENDS)
set(BUILD_SDL OFF)
set(BUILD_QT OFF)