CMake: Move BUILD_GL flags to FEATURE_DEFINES
Vicki Pfau vi@endrift.com
Wed, 25 Nov 2020 21:16:30 -0800
1 files changed,
3 insertions(+),
12 deletions(-)
jump to
M
CMakeLists.txt
→
CMakeLists.txt
@@ -457,17 +457,20 @@ set(OPENGLES2_LIBRARY "" CACHE PATH "" FORCE)
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()@@ -910,18 +913,6 @@ set(BUILD_PERF OFF)
set(BUILD_TEST OFF) set(BUILD_SUITE OFF) 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)