2021-02-09 15:38:51 -07:00
|
|
|
set (CMAKE_CXX_STANDARD 17)
|
2019-06-21 17:28:32 -06:00
|
|
|
|
2022-05-21 11:54:55 -06:00
|
|
|
include(FixInterfaceIncludes)
|
|
|
|
|
2019-04-30 21:16:54 -06:00
|
|
|
add_library(core STATIC
|
2022-05-21 11:54:55 -06:00
|
|
|
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
|
2023-10-11 09:20:05 -06:00
|
|
|
FATIO.cpp
|
2022-05-21 11:54:55 -06:00
|
|
|
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
|
2023-06-30 05:28:52 -06:00
|
|
|
ROMList.cpp
|
2022-05-21 11:54:55 -06:00
|
|
|
FreeBIOS.h
|
2023-09-18 13:09:11 -06:00
|
|
|
FreeBIOS.cpp
|
2022-05-21 11:54:55 -06:00
|
|
|
RTC.cpp
|
|
|
|
Savestate.cpp
|
|
|
|
SPI.cpp
|
2023-09-18 13:09:11 -06:00
|
|
|
SPI_Firmware.cpp
|
2022-05-21 11:54:55 -06:00
|
|
|
SPU.cpp
|
|
|
|
types.h
|
|
|
|
version.h
|
|
|
|
Wifi.cpp
|
|
|
|
WifiAP.cpp
|
|
|
|
|
|
|
|
fatfs/ff.c
|
|
|
|
fatfs/ffsystem.c
|
|
|
|
fatfs/ffunicode.c
|
|
|
|
fatfs/ffconf.h
|
|
|
|
|
|
|
|
sha1/sha1.c
|
|
|
|
tiny-AES-c/aes.c
|
|
|
|
xxhash/xxhash.c)
|
2019-06-21 17:28:32 -06:00
|
|
|
|
2023-10-22 07:35:31 -06:00
|
|
|
if (ENABLE_GDBSTUB)
|
|
|
|
message(NOTICE "Enabling GDB stub")
|
|
|
|
target_sources(core PRIVATE
|
|
|
|
debug/GdbStub.cpp
|
|
|
|
debug/GdbProto.cpp
|
|
|
|
debug/GdbCmds.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-09-30 15:58:42 -06:00
|
|
|
if (ENABLE_OGLRENDERER)
|
2022-05-21 11:54:55 -06:00
|
|
|
target_sources(core PRIVATE
|
|
|
|
GPU_OpenGL.cpp
|
|
|
|
GPU_OpenGL_shaders.h
|
|
|
|
GPU3D_OpenGL.cpp
|
|
|
|
GPU3D_OpenGL_shaders.h
|
|
|
|
OpenGLSupport.cpp)
|
2022-10-17 14:55:11 -06:00
|
|
|
|
|
|
|
target_compile_definitions(core PUBLIC OGLRENDERER_ENABLED)
|
2020-09-30 15:58:42 -06:00
|
|
|
endif()
|
|
|
|
|
2019-07-14 11:24:00 -06:00
|
|
|
if (ENABLE_JIT)
|
2022-05-21 11:54:55 -06:00
|
|
|
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()
|
2019-07-14 11:24:00 -06:00
|
|
|
endif()
|
2019-04-30 21:16:54 -06:00
|
|
|
|
2021-06-06 10:27:26 -06:00
|
|
|
add_subdirectory(teakra EXCLUDE_FROM_ALL)
|
2022-10-12 12:49:15 -06:00
|
|
|
# Workaround for building teakra with -O0 on Windows either failing or hanging forever
|
|
|
|
target_compile_options(teakra PRIVATE "$<$<CONFIG:DEBUG>:-Og>")
|
2022-05-21 11:54:55 -06:00
|
|
|
target_link_libraries(core PRIVATE teakra)
|
2021-06-06 10:27:26 -06:00
|
|
|
|
2022-05-21 11:54:55 -06:00
|
|
|
find_library(m MATH_LIBRARY)
|
|
|
|
|
|
|
|
if (MATH_LIBRARY)
|
|
|
|
target_link_libraries(core PRIVATE ${MATH_LIBRARY})
|
|
|
|
endif()
|
2021-06-06 10:27:26 -06:00
|
|
|
|
2022-05-21 11:54:55 -06:00
|
|
|
if (ENABLE_JIT)
|
|
|
|
target_compile_definitions(core PUBLIC JIT_ENABLED)
|
|
|
|
|
|
|
|
if (ENABLE_JIT_PROFILING)
|
2023-04-12 17:46:10 -06:00
|
|
|
include(../cmake/FindVTune.cmake)
|
2022-05-21 11:54:55 -06:00
|
|
|
add_definitions(-DJIT_PROFILING_ENABLED)
|
2021-01-22 11:20:32 -07:00
|
|
|
endif()
|
2022-05-21 11:54:55 -06:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32)
|
2023-10-22 07:35:31 -06:00
|
|
|
target_link_libraries(core PRIVATE ole32 comctl32 wsock32 ws2_32)
|
2022-05-21 11:54:55 -06:00
|
|
|
elseif(NOT APPLE)
|
2023-07-07 17:36:22 -06:00
|
|
|
check_library_exists(rt shm_open "" NEED_LIBRT)
|
|
|
|
if (NEED_LIBRT)
|
|
|
|
target_link_libraries(core PRIVATE rt)
|
|
|
|
endif()
|
2021-01-11 15:01:23 -07:00
|
|
|
endif()
|
2021-07-24 08:20:03 -06:00
|
|
|
|
|
|
|
if (ENABLE_JIT_PROFILING)
|
2023-04-12 17:46:10 -06:00
|
|
|
target_include_directories(core PRIVATE "${VTUNE_INCLUDE_DIR}")
|
|
|
|
target_link_libraries(core PRIVATE "${VTUNE_LIBRARY}")
|
2021-12-29 10:13:22 -07:00
|
|
|
endif()
|
2023-10-22 07:35:31 -06:00
|
|
|
|
|
|
|
#if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
|
|
# set(
|
|
|
|
# CMAKE_C_FLAGS
|
|
|
|
# "${CMAKE_C_FLAGS} -fsanitize=undefined -fsanitize=address"
|
|
|
|
# )
|
|
|
|
# target_link_options(core
|
|
|
|
# BEFORE PUBLIC -fsanitize=undefined PUBLIC -fsanitize=address
|
|
|
|
# )
|
|
|
|
#endif()
|
|
|
|
|