2019-10-04 03:54:09 +00:00
|
|
|
add_library(core
|
2023-09-16 04:39:13 +00:00
|
|
|
achievements.cpp
|
|
|
|
achievements.h
|
2023-10-31 15:32:29 +00:00
|
|
|
achievements_private.h
|
2023-09-16 04:39:13 +00:00
|
|
|
analog_controller.cpp
|
|
|
|
analog_controller.h
|
|
|
|
analog_joystick.cpp
|
|
|
|
analog_joystick.h
|
|
|
|
bios.cpp
|
|
|
|
bios.h
|
|
|
|
bus.cpp
|
|
|
|
bus.h
|
|
|
|
cdrom.cpp
|
|
|
|
cdrom.h
|
|
|
|
cdrom_async_reader.cpp
|
|
|
|
cdrom_async_reader.h
|
|
|
|
cheats.cpp
|
|
|
|
cheats.h
|
|
|
|
controller.cpp
|
|
|
|
controller.h
|
|
|
|
cpu_code_cache.cpp
|
|
|
|
cpu_code_cache.h
|
2023-10-03 14:19:17 +00:00
|
|
|
cpu_code_cache_private.h
|
2023-09-16 04:39:13 +00:00
|
|
|
cpu_core.cpp
|
|
|
|
cpu_core.h
|
|
|
|
cpu_core_private.h
|
|
|
|
cpu_disasm.cpp
|
|
|
|
cpu_disasm.h
|
2023-12-06 06:45:17 +00:00
|
|
|
cpu_pgxp.cpp
|
|
|
|
cpu_pgxp.h
|
2023-09-16 04:39:13 +00:00
|
|
|
cpu_types.cpp
|
|
|
|
cpu_types.h
|
|
|
|
digital_controller.cpp
|
|
|
|
digital_controller.h
|
|
|
|
dma.cpp
|
|
|
|
dma.h
|
|
|
|
fullscreen_ui.cpp
|
|
|
|
fullscreen_ui.h
|
|
|
|
game_database.cpp
|
|
|
|
game_database.h
|
|
|
|
game_list.cpp
|
|
|
|
game_list.h
|
|
|
|
gdb_protocol.cpp
|
|
|
|
gdb_protocol.h
|
|
|
|
gpu.cpp
|
|
|
|
gpu.h
|
|
|
|
gpu_backend.cpp
|
|
|
|
gpu_backend.h
|
|
|
|
gpu_commands.cpp
|
|
|
|
gpu_hw.cpp
|
|
|
|
gpu_hw.h
|
|
|
|
gpu_hw_shadergen.cpp
|
|
|
|
gpu_hw_shadergen.h
|
|
|
|
gpu_shadergen.cpp
|
|
|
|
gpu_shadergen.h
|
|
|
|
gpu_sw.cpp
|
|
|
|
gpu_sw.h
|
|
|
|
gpu_sw_backend.cpp
|
|
|
|
gpu_sw_backend.h
|
|
|
|
gpu_types.h
|
|
|
|
guncon.cpp
|
|
|
|
guncon.h
|
|
|
|
gte.cpp
|
|
|
|
gte.h
|
|
|
|
gte_types.h
|
|
|
|
host.cpp
|
|
|
|
host.h
|
|
|
|
host_interface_progress_callback.cpp
|
|
|
|
host_interface_progress_callback.h
|
|
|
|
hotkeys.cpp
|
|
|
|
input_types.h
|
|
|
|
imgui_overlays.cpp
|
|
|
|
imgui_overlays.h
|
|
|
|
interrupt_controller.cpp
|
|
|
|
interrupt_controller.h
|
|
|
|
mdec.cpp
|
|
|
|
mdec.h
|
|
|
|
memory_card.cpp
|
|
|
|
memory_card.h
|
|
|
|
memory_card_image.cpp
|
|
|
|
memory_card_image.h
|
|
|
|
multitap.cpp
|
|
|
|
multitap.h
|
|
|
|
negcon.cpp
|
|
|
|
negcon.h
|
|
|
|
pad.cpp
|
|
|
|
pad.h
|
|
|
|
pcdrv.cpp
|
|
|
|
pcdrv.h
|
|
|
|
playstation_mouse.cpp
|
|
|
|
playstation_mouse.h
|
|
|
|
psf_loader.cpp
|
|
|
|
psf_loader.h
|
|
|
|
resources.cpp
|
|
|
|
resources.h
|
|
|
|
save_state_version.h
|
|
|
|
settings.cpp
|
|
|
|
settings.h
|
|
|
|
shader_cache_version.h
|
|
|
|
sio.cpp
|
|
|
|
sio.h
|
|
|
|
spu.cpp
|
|
|
|
spu.h
|
|
|
|
system.cpp
|
|
|
|
system.h
|
|
|
|
texture_replacements.cpp
|
|
|
|
texture_replacements.h
|
|
|
|
timers.cpp
|
|
|
|
timers.h
|
|
|
|
timing_event.cpp
|
|
|
|
timing_event.h
|
|
|
|
types.h
|
2019-10-04 03:54:09 +00:00
|
|
|
)
|
|
|
|
|
2019-11-27 15:55:33 +00:00
|
|
|
set(RECOMPILER_SRCS
|
2023-09-16 04:39:13 +00:00
|
|
|
cpu_recompiler_code_generator.cpp
|
|
|
|
cpu_recompiler_code_generator.h
|
|
|
|
cpu_recompiler_code_generator_generic.cpp
|
|
|
|
cpu_recompiler_register_cache.cpp
|
|
|
|
cpu_recompiler_register_cache.h
|
|
|
|
cpu_recompiler_thunks.h
|
|
|
|
cpu_recompiler_types.h
|
2019-11-27 15:55:33 +00:00
|
|
|
)
|
|
|
|
|
2023-10-03 14:39:18 +00:00
|
|
|
set(NEWREC_SOURCES
|
|
|
|
cpu_newrec_compiler.cpp
|
|
|
|
cpu_newrec_compiler.h
|
|
|
|
)
|
|
|
|
|
2023-09-02 03:41:41 +00:00
|
|
|
target_precompile_headers(core PRIVATE "pch.h")
|
2019-10-04 03:54:09 +00:00
|
|
|
target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
|
|
|
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
2024-02-03 07:12:40 +00:00
|
|
|
target_link_libraries(core PUBLIC Threads::Threads common util ZLIB::ZLIB)
|
2024-03-06 06:24:25 +00:00
|
|
|
target_link_libraries(core PRIVATE xxhash imgui rapidyaml rcheevos)
|
2021-01-07 15:11:19 +00:00
|
|
|
|
2023-11-24 09:14:57 +00:00
|
|
|
if(CPU_ARCH_X64)
|
2023-10-21 06:23:01 +00:00
|
|
|
target_compile_definitions(core PUBLIC "ENABLE_RECOMPILER=1" "ENABLE_NEWREC=1" "ENABLE_MMAP_FASTMEM=1")
|
|
|
|
target_sources(core PRIVATE ${RECOMPILER_SRCS} ${NEWREC_SOURCES}
|
2019-11-27 15:55:33 +00:00
|
|
|
cpu_recompiler_code_generator_x64.cpp
|
2023-10-21 06:23:01 +00:00
|
|
|
cpu_newrec_compiler_x64.cpp
|
|
|
|
cpu_newrec_compiler_x64.h
|
2019-11-27 15:55:33 +00:00
|
|
|
)
|
2023-11-24 09:14:57 +00:00
|
|
|
target_link_libraries(core PRIVATE xbyak)
|
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
target_link_libraries(core PRIVATE zydis)
|
|
|
|
endif()
|
2019-11-19 10:30:04 +00:00
|
|
|
message("Building x64 recompiler")
|
2023-11-24 09:14:57 +00:00
|
|
|
endif()
|
|
|
|
if(CPU_ARCH_ARM32)
|
2023-10-21 06:23:01 +00:00
|
|
|
target_compile_definitions(core PUBLIC "ENABLE_RECOMPILER=1" "ENABLE_NEWREC=1")
|
|
|
|
target_sources(core PRIVATE ${RECOMPILER_SRCS} ${NEWREC_SOURCES}
|
2020-11-20 16:06:44 +00:00
|
|
|
cpu_recompiler_code_generator_aarch32.cpp
|
2023-10-21 06:23:01 +00:00
|
|
|
cpu_newrec_compiler_aarch32.cpp
|
|
|
|
cpu_newrec_compiler_aarch32.h
|
2020-11-20 16:06:44 +00:00
|
|
|
)
|
2020-11-22 15:06:25 +00:00
|
|
|
target_link_libraries(core PUBLIC vixl)
|
2020-11-20 16:06:44 +00:00
|
|
|
message("Building AArch32 recompiler")
|
2023-11-24 09:14:57 +00:00
|
|
|
endif()
|
|
|
|
if(CPU_ARCH_ARM64)
|
2023-10-21 06:23:01 +00:00
|
|
|
target_compile_definitions(core PUBLIC "ENABLE_RECOMPILER=1" "ENABLE_NEWREC=1" "ENABLE_MMAP_FASTMEM=1")
|
|
|
|
target_sources(core PRIVATE ${RECOMPILER_SRCS} ${NEWREC_SOURCES}
|
2019-12-02 15:29:56 +00:00
|
|
|
cpu_recompiler_code_generator_aarch64.cpp
|
2023-10-21 06:23:01 +00:00
|
|
|
cpu_newrec_compiler_aarch64.cpp
|
|
|
|
cpu_newrec_compiler_aarch64.h
|
2019-12-02 15:29:56 +00:00
|
|
|
)
|
2020-11-22 15:06:25 +00:00
|
|
|
target_link_libraries(core PUBLIC vixl)
|
2019-12-02 15:29:56 +00:00
|
|
|
message("Building AArch64 recompiler")
|
2023-11-24 09:14:57 +00:00
|
|
|
endif()
|
|
|
|
if(CPU_ARCH_RISCV64)
|
2023-10-21 06:23:01 +00:00
|
|
|
target_compile_definitions(core PUBLIC "ENABLE_NEWREC=1" "ENABLE_MMAP_FASTMEM=1")
|
|
|
|
target_sources(core PRIVATE ${NEWREC_SOURCES}
|
|
|
|
cpu_newrec_compiler_riscv64.cpp
|
|
|
|
cpu_newrec_compiler_riscv64.h
|
|
|
|
)
|
|
|
|
target_link_libraries(core PUBLIC biscuit::biscuit riscv-disas)
|
|
|
|
message("Building RISC-V 64-bit recompiler")
|
2019-11-19 10:30:04 +00:00
|
|
|
endif()
|
2022-03-26 13:51:37 +00:00
|
|
|
|
2023-08-13 06:28:28 +00:00
|
|
|
if(ENABLE_DISCORD_PRESENCE)
|
2023-09-17 02:28:11 +00:00
|
|
|
target_compile_definitions(core PUBLIC -DENABLE_DISCORD_PRESENCE=1)
|
2023-08-13 06:28:28 +00:00
|
|
|
target_link_libraries(core PRIVATE discord-rpc)
|
2022-03-26 13:51:37 +00:00
|
|
|
endif()
|
2023-08-13 06:28:28 +00:00
|
|
|
|
2023-09-10 04:14:27 +00:00
|
|
|
# Copy the provided data directory to the output directory. Borrowed from PCSX2.
|
|
|
|
function(add_resources target path basedir)
|
|
|
|
get_filename_component(dir ${path} DIRECTORY)
|
|
|
|
file(RELATIVE_PATH subdir ${basedir} ${dir})
|
|
|
|
if(APPLE)
|
|
|
|
target_sources(${target} PRIVATE ${path})
|
|
|
|
set_source_files_properties(${path} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/${subdir})
|
|
|
|
else()
|
|
|
|
add_custom_command(TARGET ${target} POST_BUILD
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E make_directory "$<TARGET_FILE_DIR:${target}>/resources/${subdir}"
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${path}" "$<TARGET_FILE_DIR:${target}>/resources/${subdir}")
|
|
|
|
endif()
|
|
|
|
source_group(Resources/${subdir} FILES ${path})
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(add_core_resources target)
|
|
|
|
add_util_resources(${target})
|
|
|
|
|
|
|
|
file(GLOB_RECURSE RESOURCE_FILES ${CMAKE_SOURCE_DIR}/data/resources/*)
|
|
|
|
foreach(path IN LISTS RESOURCE_FILES)
|
|
|
|
get_filename_component(file ${path} NAME)
|
|
|
|
if("${file}" MATCHES "^\\.") # Don't copy macOS garbage (mainly Finder's .DS_Store files) into application
|
|
|
|
continue()
|
|
|
|
endif()
|
|
|
|
add_resources(${target} ${path} ${CMAKE_SOURCE_DIR}/data/resources/)
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|