mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-31 10:09:46 -06:00

* WIP: use Duckstation's context code to directly render into QT Widget from separate thread without two OpenGL contexts currently only works on Windows * reenable gay OSD * add back vsync * make it atleast a little more thread safe * linux support * don't segfault on closing * reorganise and cleanup build system it's still not good, but better than before * macos? * try to get it working on Ubuntu CI also update instructions * let's try this * ok how about this * try creating an OGL 4.3 context first (https://i.kym-cdn.com/photos/images/original/001/264/842/220.png) * fix Ubuntu * hm * try again for Windows * let's try this * make the OpenGL renderer work again that was stupid * do OGL surface resizing from the mainthread * Fix small mistake in GL context creation on macOS causing version 3.2 to be considered invalid * C stupidness * cleanup * don't let the emuthread deinit OGL if there's no OGL * reset lastScreenWidth/Height when deiniting OpenGL * disable stencil test while drawing framebuffers * macOS: Link Cocoa framework explicitly when not building with Qt6 Seems to be needed for the classes used by DuckStation's GL context code. * Set ScreenPanelGL's minimum size immediately Fixes GL context creation for OpenGL display on macOS using the wrong size as the underlying window was not resized to the correct size by Qt yet. * don't emit window updates when OGL display is used * stuff Arisotura said Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
139 lines
2.9 KiB
CMake
139 lines
2.9 KiB
CMake
set (CMAKE_CXX_STANDARD 17)
|
|
|
|
include(FixInterfaceIncludes)
|
|
|
|
add_library(core STATIC
|
|
ARCodeFile.cpp
|
|
AREngine.cpp
|
|
ARM.cpp
|
|
ARM_InstrTable.h
|
|
ARMInterpreter.cpp
|
|
ARMInterpreter_ALU.cpp
|
|
ARMInterpreter_Branch.cpp
|
|
ARMInterpreter_LoadStore.cpp
|
|
CP15.cpp
|
|
CRC32.cpp
|
|
DMA.cpp
|
|
DMA_Timings.h
|
|
DSi.cpp
|
|
DSi_AES.cpp
|
|
DSi_Camera.cpp
|
|
DSi_DSP.cpp
|
|
DSi_I2C.cpp
|
|
DSi_NAND.cpp
|
|
DSi_NDMA.cpp
|
|
DSi_NWifi.cpp
|
|
DSi_SD.cpp
|
|
DSi_SPI_TSC.cpp
|
|
FATStorage.cpp
|
|
FIFO.h
|
|
GBACart.cpp
|
|
GPU.cpp
|
|
GPU2D.cpp
|
|
GPU2D_Soft.cpp
|
|
GPU3D.cpp
|
|
GPU3D_Soft.cpp
|
|
melonDLDI.h
|
|
NDS.cpp
|
|
NDSCart.cpp
|
|
Platform.h
|
|
ROMList.h
|
|
FreeBIOS.h
|
|
RTC.cpp
|
|
Savestate.cpp
|
|
SPI.cpp
|
|
SPU.cpp
|
|
types.h
|
|
version.h
|
|
Wifi.cpp
|
|
WifiAP.cpp
|
|
|
|
fatfs/diskio.c
|
|
fatfs/ff.c
|
|
fatfs/ffsystem.c
|
|
fatfs/ffunicode.c
|
|
fatfs/ffconf.h
|
|
|
|
sha1/sha1.c
|
|
tiny-AES-c/aes.c
|
|
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)
|
|
|
|
target_compile_definitions(core PUBLIC OGLRENDERER_ENABLED)
|
|
endif()
|
|
|
|
if (ENABLE_JIT)
|
|
enable_language(ASM)
|
|
|
|
target_sources(core PRIVATE
|
|
ARM_InstrInfo.cpp
|
|
|
|
ARMJIT.cpp
|
|
ARMJIT_Memory.cpp
|
|
|
|
dolphin/CommonFuncs.cpp)
|
|
|
|
if (ARCHITECTURE STREQUAL x86_64)
|
|
target_sources(core PRIVATE
|
|
dolphin/x64ABI.cpp
|
|
dolphin/x64CPUDetect.cpp
|
|
dolphin/x64Emitter.cpp
|
|
|
|
ARMJIT_x64/ARMJIT_Compiler.cpp
|
|
ARMJIT_x64/ARMJIT_ALU.cpp
|
|
ARMJIT_x64/ARMJIT_LoadStore.cpp
|
|
ARMJIT_x64/ARMJIT_Branch.cpp
|
|
|
|
ARMJIT_x64/ARMJIT_Linkage.S)
|
|
endif()
|
|
if (ARCHITECTURE STREQUAL ARM64)
|
|
target_sources(core PRIVATE
|
|
dolphin/Arm64Emitter.cpp
|
|
dolphin/MathUtil.cpp
|
|
|
|
ARMJIT_A64/ARMJIT_Compiler.cpp
|
|
ARMJIT_A64/ARMJIT_ALU.cpp
|
|
ARMJIT_A64/ARMJIT_LoadStore.cpp
|
|
ARMJIT_A64/ARMJIT_Branch.cpp
|
|
|
|
ARMJIT_A64/ARMJIT_Linkage.S)
|
|
endif()
|
|
endif()
|
|
|
|
add_subdirectory(teakra EXCLUDE_FROM_ALL)
|
|
# Workaround for building teakra with -O0 on Windows either failing or hanging forever
|
|
target_compile_options(teakra PRIVATE "$<$<CONFIG:DEBUG>:-Og>")
|
|
target_link_libraries(core PRIVATE teakra)
|
|
|
|
find_library(m MATH_LIBRARY)
|
|
|
|
if (MATH_LIBRARY)
|
|
target_link_libraries(core PRIVATE ${MATH_LIBRARY})
|
|
endif()
|
|
|
|
if (ENABLE_JIT)
|
|
target_compile_definitions(core PUBLIC JIT_ENABLED)
|
|
|
|
if (ENABLE_JIT_PROFILING)
|
|
include(cmake/FindVTune.cmake)
|
|
add_definitions(-DJIT_PROFILING_ENABLED)
|
|
endif()
|
|
endif()
|
|
|
|
if (WIN32)
|
|
target_link_libraries(core PRIVATE ole32 comctl32 ws2_32)
|
|
elseif(NOT APPLE)
|
|
target_link_libraries(core PRIVATE rt)
|
|
endif()
|
|
|
|
if (ENABLE_JIT_PROFILING)
|
|
target_link_libraries(core PRIVATE jitprofiling)
|
|
endif()
|