make OpenGL renderer a build option

mostly meant for the Switch port
This commit is contained in:
RSDuck
2020-09-30 23:58:42 +02:00
parent 4b705556bc
commit 6977302403
9 changed files with 67 additions and 11 deletions

View File

@ -26,17 +26,12 @@ add_library(core STATIC
FIFO.h
GBACart.cpp
GPU.cpp
GPU_OpenGL.cpp
GPU_OpenGL_shaders.h
GPU2D.cpp
GPU3D.cpp
GPU3D_OpenGL.cpp
GPU3D_OpenGL_shaders.h
GPU3D_Soft.cpp
melonDLDI.h
NDS.cpp
NDSCart.cpp
OpenGLSupport.cpp
Platform.h
ROMList.h
RTC.cpp
@ -52,6 +47,16 @@ add_library(core STATIC
xxhash/xxhash.c
)
if (ENABLE_OGLRENDERER)
target_sources(core PRIVATE
GPU_OpenGL.cpp
GPU_OpenGL_shaders.h
GPU3D_OpenGL.cpp
GPU3D_OpenGL_shaders.h
OpenGLSupport.cpp
)
endif()
if (ENABLE_JIT)
enable_language(ASM)
@ -95,8 +100,16 @@ if (ENABLE_JIT)
endif()
endif()
if (WIN32)
target_link_libraries(core ole32 comctl32 ws2_32 opengl32)
if (ENABLE_OGLRENDERER)
if (WIN32)
target_link_libraries(core ole32 comctl32 ws2_32 opengl32)
else()
target_link_libraries(core GL EGL)
endif()
else()
target_link_libraries(core GL EGL)
endif()
if (WIN32)
target_link_libraries(core ole32 comctl32 ws2_32)
else()
target_link_libraries(core)
endif()
endif()