all repos — mgba @ 2e2ad705500f0f52769c14b6f9722def9057633c

mGBA Game Boy Advance Emulator

CMake: Move BUILD_GL flags to FEATURE_DEFINES
Vicki Pfau vi@endrift.com
Wed, 25 Nov 2020 21:16:30 -0800
commit

2e2ad705500f0f52769c14b6f9722def9057633c

parent

b169e6b0dfa177ca6390d7f9e025e7412a22afe8

1 files changed, 3 insertions(+), 12 deletions(-)

jump to
M CMakeLists.txtCMakeLists.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)