mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 12:39:13 +12:00
Fix optional OpenGL enablement
Software renderer requires OpenGL, so AlberCore requries OpenGL. The QT frontend currently requires OpenGL due to `ScreenWidget`
This commit is contained in:
parent
772573527c
commit
b147df6094
1 changed files with 76 additions and 69 deletions
|
@ -72,6 +72,9 @@ endif()
|
||||||
|
|
||||||
if(ENABLE_QT_GUI)
|
if(ENABLE_QT_GUI)
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Widgets)
|
find_package(Qt6 REQUIRED COMPONENTS Widgets)
|
||||||
|
if(NOT ENABLE_OPENGL)
|
||||||
|
message(FATAL_ERROR "Qt frontend requires OpenGL")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SDL_STATIC ON CACHE BOOL "" FORCE)
|
set(SDL_STATIC ON CACHE BOOL "" FORCE)
|
||||||
|
@ -309,7 +312,6 @@ set(RENDERER_GL_SOURCE_FILES "") # Empty by default unless we are compiling with
|
||||||
set(RENDERER_VK_SOURCE_FILES "") # Empty by default unless we are compiling with the VK renderer
|
set(RENDERER_VK_SOURCE_FILES "") # Empty by default unless we are compiling with the VK renderer
|
||||||
|
|
||||||
if(ENABLE_OPENGL)
|
if(ENABLE_OPENGL)
|
||||||
find_package(OpenGL REQUIRED COMPONENTS OpenGL EGL GLX)
|
|
||||||
|
|
||||||
# This may look weird but opengl.hpp is our header even if it's in the third_party folder
|
# This may look weird but opengl.hpp is our header even if it's in the third_party folder
|
||||||
set(RENDERER_GL_INCLUDE_FILES third_party/opengl/opengl.hpp
|
set(RENDERER_GL_INCLUDE_FILES third_party/opengl/opengl.hpp
|
||||||
|
@ -419,9 +421,9 @@ if(ANDROID)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_HYDRA_CORE)
|
if(BUILD_HYDRA_CORE)
|
||||||
|
add_library(AlberCore SHARED ${ALL_SOURCES} src/hydra_core.cpp)
|
||||||
target_compile_definitions(AlberCore PRIVATE PANDA3DS_HYDRA_CORE=1)
|
target_compile_definitions(AlberCore PRIVATE PANDA3DS_HYDRA_CORE=1)
|
||||||
include_directories(third_party/hydra_core/include)
|
include_directories(third_party/hydra_core/include)
|
||||||
add_library(AlberCore SHARED ${ALL_SOURCES} src/hydra_core.cpp)
|
|
||||||
else()
|
else()
|
||||||
add_library(AlberCore STATIC ${ALL_SOURCES})
|
add_library(AlberCore STATIC ${ALL_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
@ -458,7 +460,7 @@ endif()
|
||||||
|
|
||||||
if(ENABLE_OPENGL)
|
if(ENABLE_OPENGL)
|
||||||
target_compile_definitions(AlberCore PUBLIC "PANDA3DS_ENABLE_OPENGL=1")
|
target_compile_definitions(AlberCore PUBLIC "PANDA3DS_ENABLE_OPENGL=1")
|
||||||
target_link_libraries(AlberCore PRIVATE OpenGL::OpenGL OpenGL::EGL OpenGL::GLX resources_renderer_gl)
|
target_link_libraries(AlberCore PRIVATE resources_renderer_gl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_VULKAN)
|
if(ENABLE_VULKAN)
|
||||||
|
@ -502,6 +504,11 @@ if(ENABLE_QT_GUI)
|
||||||
if(LINUX OR FREEBSD)
|
if(LINUX OR FREEBSD)
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
target_link_libraries(Alber PRIVATE ${X11_LIBRARIES})
|
target_link_libraries(Alber PRIVATE ${X11_LIBRARIES})
|
||||||
|
|
||||||
|
if(ENABLE_OPENGL)
|
||||||
|
find_package(OpenGL REQUIRED COMPONENTS OpenGL EGL GLX)
|
||||||
|
target_link_libraries(Alber PRIVATE OpenGL::OpenGL OpenGL::EGL OpenGL::GLX)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_add_resources(AlberCore "app_images"
|
qt_add_resources(AlberCore "app_images"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue