mirror of
https://github.com/libretro/mgba.git
synced 2024-11-27 18:20:33 +00:00
All: Clean up OpenGL detection
This commit is contained in:
parent
fe845d1ee8
commit
87d26d39f9
@ -16,6 +16,7 @@ set(BUILD_LIBRETRO OFF CACHE BOOL "Build libretro core")
|
||||
set(BUILD_PERF OFF CACHE BOOL "Build performance profiling tool")
|
||||
set(BUILD_STATIC OFF CACHE BOOL "Build a static library")
|
||||
set(BUILD_SHARED ON CACHE BOOL "Build a shared library")
|
||||
set(BUILD_GL ON CACHE STRING "Build with OpenGL")
|
||||
file(GLOB ARM_SRC ${CMAKE_SOURCE_DIR}/src/arm/*.c)
|
||||
file(GLOB GBA_SRC ${CMAKE_SOURCE_DIR}/src/gba/*.c)
|
||||
file(GLOB GBA_CHEATS_SRC ${CMAKE_SOURCE_DIR}/src/gba/cheats/*.c)
|
||||
@ -147,6 +148,12 @@ if(CMAKE_SYSTEM_NAME MATCHES .*BSD)
|
||||
else()
|
||||
find_feature(USE_CLI_DEBUGGER "libedit")
|
||||
endif()
|
||||
if(BUILD_GL)
|
||||
find_package(OpenGL QUIET)
|
||||
if(NOT OPENGL_FOUND)
|
||||
set(BUILD_GL OFF)
|
||||
endif()
|
||||
endif()
|
||||
find_feature(USE_FFMPEG "libavcodec;libavformat;libavresample;libavutil;libswscale")
|
||||
find_feature(USE_PNG "ZLIB;PNG")
|
||||
find_feature(USE_LIBZIP "libzip")
|
||||
@ -399,6 +406,10 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} COMPILE_DEFINITIONS "${FEATURE_DEFINES}")
|
||||
|
||||
if(BUILD_GL)
|
||||
add_definitions(-DBUILD_GL)
|
||||
endif()
|
||||
|
||||
if(BUILD_LIBRETRO)
|
||||
file(GLOB RETRO_SRC ${CMAKE_SOURCE_DIR}/src/platform/libretro/*.c)
|
||||
add_library(${BINARY_NAME}_libretro SHARED ${CORE_SRC} ${RETRO_SRC})
|
||||
|
@ -31,7 +31,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
find_package(Qt5Multimedia)
|
||||
find_package(Qt5OpenGL)
|
||||
find_package(Qt5Widgets)
|
||||
find_package(OpenGL)
|
||||
|
||||
if(NOT Qt5OpenGL_FOUND OR NOT Qt5Widgets_FOUND OR NOT OPENGL_FOUND)
|
||||
message(WARNING "Cannot find Qt modules")
|
||||
|
@ -1,5 +1,4 @@
|
||||
set(SDL_VERSION "2" CACHE STRING "Version of SDL to use (1.2 or 2)")
|
||||
set(BUILD_GL ON CACHE STRING "Build with OpenGL")
|
||||
|
||||
if (SDL_VERSION EQUAL "2")
|
||||
include(FindPkgConfig)
|
||||
@ -66,12 +65,8 @@ if(BUILD_PANDORA)
|
||||
else()
|
||||
list(APPEND MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sw-sdl.c)
|
||||
if(BUILD_GL)
|
||||
find_package(OpenGL)
|
||||
endif()
|
||||
if(OPENGL_FOUND)
|
||||
list(APPEND MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/gl-sdl.c)
|
||||
list(APPEND PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/opengl/gl.c)
|
||||
add_definitions(-DBUILD_GL)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user