2023-04-27 18:13:19 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16.3)
|
2023-11-05 12:22:18 +01:00
|
|
|
|
2023-05-02 17:22:19 +02:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
2023-04-27 18:13:19 +02:00
|
|
|
|
2023-11-05 12:22:18 +01:00
|
|
|
if (NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
2023-05-03 18:40:47 +02:00
|
|
|
endif()
|
|
|
|
|
2023-04-27 18:13:19 +02:00
|
|
|
project(shadps4)
|
|
|
|
|
2023-11-05 16:08:47 +01:00
|
|
|
# This function should be passed a list of all files in a target. It will automatically generate
|
|
|
|
# file groups following the directory hierarchy, so that the layout of the files in IDEs matches the
|
|
|
|
# one in the filesystem.
|
|
|
|
function(create_target_directory_groups target_name)
|
|
|
|
# Place any files that aren't in the source list in a separate group so that they don't get in
|
|
|
|
# the way.
|
|
|
|
source_group("Other Files" REGULAR_EXPRESSION ".")
|
|
|
|
|
|
|
|
get_target_property(target_sources "${target_name}" SOURCES)
|
|
|
|
|
|
|
|
foreach(file_name IN LISTS target_sources)
|
|
|
|
get_filename_component(dir_name "${file_name}" PATH)
|
|
|
|
# Group names use '\' as a separator even though the entire rest of CMake uses '/'...
|
|
|
|
string(REPLACE "/" "\\" group_name "${dir_name}")
|
|
|
|
source_group("${group_name}" FILES "${file_name}")
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|
|
|
|
|
2023-11-05 12:22:18 +01:00
|
|
|
add_subdirectory(third-party)
|
2023-08-02 14:16:00 +02:00
|
|
|
include_directories(src)
|
2023-04-27 18:13:19 +02:00
|
|
|
|
2024-02-14 23:52:57 +01:00
|
|
|
set(LIBC_SOURCES src/core/hle/libraries/libc/libc.cpp
|
|
|
|
src/core/hle/libraries/libc/libc.h
|
2023-11-06 00:11:54 +01:00
|
|
|
src/core/hle/libraries/libc/printf.h
|
|
|
|
src/core/hle/libraries/libc/va_ctx.h
|
|
|
|
src/core/hle/libraries/libc/libc_cxa.cpp
|
|
|
|
src/core/hle/libraries/libc/libc_cxa.h
|
2023-10-31 14:53:46 +01:00
|
|
|
src/core/hle/libraries/libc/libc_stdio.cpp
|
|
|
|
src/core/hle/libraries/libc/libc_stdio.h
|
|
|
|
src/core/hle/libraries/libc/libc_math.cpp
|
|
|
|
src/core/hle/libraries/libc/libc_math.h
|
2023-10-31 16:32:56 +01:00
|
|
|
src/core/hle/libraries/libc/libc_string.cpp
|
|
|
|
src/core/hle/libraries/libc/libc_string.h
|
2023-10-31 17:12:05 +01:00
|
|
|
src/core/hle/libraries/libc/libc_stdlib.cpp
|
|
|
|
src/core/hle/libraries/libc/libc_stdlib.h
|
2023-10-06 20:49:53 +02:00
|
|
|
)
|
2023-11-06 00:11:54 +01:00
|
|
|
set(USERSERVICE_SOURCES src/core/hle/libraries/libuserservice/libuserservice.cpp
|
|
|
|
src/core/hle/libraries/libuserservice/libuserservice.h
|
2023-10-06 20:49:53 +02:00
|
|
|
)
|
|
|
|
|
2023-10-31 12:35:52 +01:00
|
|
|
set(PAD_SOURCES src/core/hle/libraries/libpad/pad.cpp
|
|
|
|
src/core/hle/libraries/libpad/pad.h
|
2023-10-07 11:03:03 +02:00
|
|
|
)
|
|
|
|
|
2023-10-31 13:04:35 +01:00
|
|
|
set(SYSTEMSERVICE_SOURCES src/core/hle/libraries/libsystemservice/system_service.cpp
|
|
|
|
src/core/hle/libraries/libsystemservice/system_service.h
|
2023-10-07 11:03:03 +02:00
|
|
|
)
|
|
|
|
|
2023-10-31 12:35:52 +01:00
|
|
|
set(FILESYSTEM_SOURCES src/core/hle/libraries/libkernel/file_system.cpp
|
2023-11-19 09:22:46 +01:00
|
|
|
src/core/hle/libraries/libkernel/file_system.h
|
|
|
|
src/core/file_sys/fs.cpp
|
|
|
|
src/core/file_sys/fs.h
|
2023-10-20 06:25:52 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
set(HOST_SOURCES src/Emulator/Host/controller.cpp
|
|
|
|
src/Emulator/Host/controller.h
|
2023-10-19 11:13:09 +02:00
|
|
|
)
|
|
|
|
|
2023-04-27 18:13:19 +02:00
|
|
|
add_executable(shadps4
|
2023-11-05 13:21:20 +01:00
|
|
|
src/common/debug.h
|
|
|
|
src/common/disassembler.cpp
|
|
|
|
src/common/disassembler.h
|
|
|
|
src/common/discord.cpp
|
|
|
|
src/common/discord.h
|
|
|
|
src/common/fs_file.cpp
|
|
|
|
src/common/fs_file.h
|
|
|
|
src/common/log.cpp
|
|
|
|
src/common/log.h
|
2024-02-14 23:52:57 +01:00
|
|
|
src/common/native_clock.cpp
|
|
|
|
src/common/native_clock.h
|
|
|
|
src/common/rdtsc.cpp
|
|
|
|
src/common/rdtsc.h
|
2023-11-05 13:21:20 +01:00
|
|
|
src/common/singleton.h
|
|
|
|
src/common/string_util.cpp
|
|
|
|
src/common/string_util.h
|
|
|
|
src/common/types.h
|
2024-02-14 23:52:57 +01:00
|
|
|
src/common/uint128.h
|
2023-11-05 13:21:20 +01:00
|
|
|
src/common/version.h
|
2023-10-06 20:49:53 +02:00
|
|
|
${LIBC_SOURCES}
|
|
|
|
${USERSERVICE_SOURCES}
|
2023-10-07 11:03:03 +02:00
|
|
|
${PAD_SOURCES}
|
|
|
|
${SYSTEMSERVICE_SOURCES}
|
2023-10-19 11:13:09 +02:00
|
|
|
${FILESYSTEM_SOURCES}
|
2023-10-20 06:25:52 +02:00
|
|
|
${HOST_SOURCES}
|
2023-04-27 18:13:19 +02:00
|
|
|
src/main.cpp
|
2023-11-06 00:11:54 +01:00
|
|
|
src/core/loader/elf.cpp
|
|
|
|
src/core/loader/elf.h
|
2023-05-03 18:40:47 +02:00
|
|
|
src/GUI/ElfViewer.cpp
|
2023-05-23 06:48:25 +02:00
|
|
|
src/GUI/ElfViewer.h
|
2023-08-14 19:17:01 +02:00
|
|
|
src/Util/config.cpp
|
|
|
|
src/Util/config.h
|
2023-10-31 07:47:58 +01:00
|
|
|
src/core/virtual_memory.cpp
|
|
|
|
src/core/virtual_memory.h
|
2023-11-06 00:11:54 +01:00
|
|
|
src/core/linker.cpp
|
|
|
|
src/core/linker.h
|
|
|
|
src/core/aerolib/stubs.cpp
|
|
|
|
src/core/aerolib/stubs.h
|
|
|
|
src/core/aerolib/aerolib.cpp
|
|
|
|
src/core/aerolib/aerolib.h
|
|
|
|
src/core/hle/kernel/Objects/physical_memory.h
|
|
|
|
src/core/hle/kernel/Objects/physical_memory.cpp
|
2023-10-31 07:47:58 +01:00
|
|
|
src/core/PS4/HLE/Graphics/video_out.cpp
|
|
|
|
src/core/PS4/HLE/Graphics/video_out.h
|
2023-11-06 00:11:54 +01:00
|
|
|
src/core/hle/kernel/event_queues.cpp
|
|
|
|
src/core/hle/kernel/event_queues.h
|
|
|
|
src/core/hle/kernel/cpu_management.cpp
|
|
|
|
src/core/hle/kernel/cpu_management.h
|
|
|
|
src/core/loader/symbols_resolver.h
|
|
|
|
src/core/loader/symbols_resolver.cpp
|
|
|
|
src/core/hle/libraries/libs.cpp
|
|
|
|
src/core/hle/libraries/libs.h
|
|
|
|
src/core/hle/libraries/libkernel/libkernel.cpp
|
|
|
|
src/core/hle/libraries/libkernel/libkernel.h
|
|
|
|
src/core/hle/libraries/libscegnmdriver/libscegnmdriver.cpp
|
|
|
|
src/core/hle/libraries/libscegnmdriver/libscegnmdriver.h
|
2023-11-10 16:31:56 +01:00
|
|
|
src/core/hle/libraries/libkernel/thread_management.cpp
|
|
|
|
src/core/hle/libraries/libkernel/thread_management.h
|
2023-11-06 00:11:54 +01:00
|
|
|
src/core/hle/kernel/memory_management.cpp
|
|
|
|
src/core/hle/kernel/memory_management.h
|
|
|
|
src/core/hle/error_codes.h
|
2023-11-05 13:21:20 +01:00
|
|
|
src/core/PS4/GPU/gpu_memory.cpp
|
|
|
|
src/core/PS4/GPU/gpu_memory.h
|
|
|
|
src/emulator.cpp
|
|
|
|
src/emulator.h
|
2023-11-06 00:11:54 +01:00
|
|
|
src/core/hle/kernel/Objects/event_queue.h
|
|
|
|
src/core/hle/kernel/Objects/event_queue.cpp
|
2023-11-05 13:21:20 +01:00
|
|
|
src/core/PS4/HLE/Graphics/Objects/video_out_ctx.cpp
|
|
|
|
src/core/PS4/HLE/Graphics/Objects/video_out_ctx.h
|
|
|
|
src/core/PS4/HLE/Graphics/graphics_ctx.h
|
|
|
|
src/vulkan_util.cpp
|
|
|
|
src/vulkan_util.h
|
|
|
|
src/core/PS4/GPU/video_out_buffer.cpp
|
|
|
|
src/core/PS4/GPU/video_out_buffer.h
|
|
|
|
src/core/PS4/HLE/Graphics/graphics_render.cpp
|
|
|
|
src/core/PS4/HLE/Graphics/graphics_render.h
|
|
|
|
src/core/PS4/GPU/tile_manager.cpp
|
|
|
|
src/core/PS4/GPU/tile_manager.h
|
|
|
|
src/core/hle/libraries/libkernel/time_management.cpp
|
|
|
|
src/core/hle/libraries/libkernel/time_management.h
|
2024-01-26 17:01:27 +01:00
|
|
|
"src/common/io_file.cpp" "src/common/io_file.h")
|
2023-04-27 18:13:19 +02:00
|
|
|
|
2023-11-05 16:08:47 +01:00
|
|
|
create_target_directory_groups(shadps4)
|
|
|
|
|
2023-11-05 12:22:18 +01:00
|
|
|
target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt spdlog::spdlog toml11::toml11)
|
|
|
|
target_link_libraries(shadps4 PRIVATE discord-rpc imgui SDL3-shared vulkan-1 xxhash Zydis)
|
|
|
|
if (WIN32)
|
|
|
|
target_link_libraries(shadps4 PRIVATE mincore winpthread)
|
|
|
|
endif()
|
2023-05-10 21:22:46 +02:00
|
|
|
|
|
|
|
add_custom_command(TARGET shadps4 POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
$<TARGET_FILE:SDL3-shared>
|
2023-06-23 03:48:55 +02:00
|
|
|
$<TARGET_FILE_DIR:shadps4>)
|
2024-02-14 23:52:57 +01:00
|
|
|
if (WIN32)
|
|
|
|
add_custom_command(TARGET shadps4 POST_BUILD
|
2023-07-17 22:19:33 +02:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${PROJECT_SOURCE_DIR}/third-party/winpthread/bin/libwinpthread-1.dll" $<TARGET_FILE_DIR:shadps4>)
|
2024-02-14 23:52:57 +01:00
|
|
|
endif()
|