@@ -33,6 +33,7 @@ endif()
3333
3434option (ENABLE_DISCORD_RPC "Enable the Discord RPC integration" ON )
3535option (ENABLE_UPDATER "Enables the options to updater" ON )
36+ option (ENABLE_TESTS "Build unit tests (requires GTest)" OFF )
3637
3738# First, determine whether to use CMAKE_OSX_ARCHITECTURES or CMAKE_SYSTEM_PROCESSOR.
3839if (APPLE AND CMAKE_OSX_ARCHITECTURES)
@@ -244,7 +245,7 @@ find_package(VulkanMemoryAllocator 3.1.0 CONFIG)
244245find_package (xbyak 7.07 CONFIG )
245246find_package (xxHash 0.8.2 MODULE )
246247find_package (ZLIB 1.3 MODULE )
247- find_package (Zydis 5.0.0 CONFIG )
248+ find_package (Zydis 5.0.0 MODULE )
248249find_package (pugixml 1.14 CONFIG )
249250if (APPLE )
250251 find_package (date 3.0.1 CONFIG )
@@ -295,8 +296,15 @@ set(AUDIO_LIB src/core/libraries/audio/audioin.cpp
295296 src/core/libraries/audio/audioout_backend.h
296297 src/core/libraries/audio/audioout_error.h
297298 src/core/libraries/audio/sdl_audio_out.cpp
299+ src/core/libraries/audio/openal_audio_out.cpp
300+ src/core/libraries/audio/openal_manager.h
298301 src/core/libraries/ngs2/ngs2.cpp
299302 src/core/libraries/ngs2/ngs2.h
303+ src/core/libraries/audio3d/audio3d.cpp
304+ src/core/libraries/audio3d/audio3d_openal.cpp
305+ src/core/libraries/audio3d/audio3d_openal.h
306+ src/core/libraries/audio3d/audio3d.h
307+ src/core/libraries/audio3d/audio3d_error.h
300308)
301309
302310set (GNM_LIB src/core/libraries/gnmdriver/gnmdriver.cpp
@@ -871,6 +879,12 @@ set(CORE src/core/aerolib/stubs.cpp
871879 src/core/tls.h
872880 src/core/emulator_state.cpp
873881 src/core/emulator_state.h
882+ src/core/emulator_settings.cpp
883+ src/core/emulator_settings.h
884+ src/core/user_manager.cpp
885+ src/core/user_manager.h
886+ src/core/user_settings.cpp
887+ src/core/user_settings.h
874888)
875889
876890if (ARCHITECTURE STREQUAL "x86_64" )
@@ -1077,6 +1091,8 @@ set(IMGUI src/imgui/imgui_config.h
10771091 src/imgui/imgui_layer.h
10781092 src/imgui/imgui_std.h
10791093 src/imgui/imgui_texture.h
1094+ src/imgui/imgui_translations.cpp
1095+ src/imgui/imgui_translations.h
10801096 src/imgui/renderer/imgui_core.cpp
10811097 src/imgui/renderer/imgui_core.h
10821098 src/imgui/renderer/imgui_impl_sdl3.cpp
@@ -1101,6 +1117,8 @@ set(EMULATOR src/emulator.cpp
11011117 src/sdl_window.cpp
11021118)
11031119
1120+ if (NOT ENABLE_TESTS)
1121+
11041122add_executable (shadps4
11051123 ${AUDIO_CORE}
11061124 ${IMGUI}
@@ -1121,7 +1139,14 @@ create_target_directory_groups(shadps4)
11211139
11221140target_link_libraries (shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient RenderDoc::API FFmpeg::ffmpeg Dear_ImGui gcn half::half ZLIB::ZLIB PNG::PNG )
11231141target_link_libraries (shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator LibAtrac9 sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::glslang SDL3::SDL3 SDL3_mixer::SDL3_mixer pugixml::pugixml )
1124- target_link_libraries (shadps4 PRIVATE stb::headers libusb::usb lfreist-hwinfo::hwinfo nlohmann_json::nlohmann_json miniz::miniz fdk-aac CLI11::CLI11 OpenAL::OpenAL Cpp_Httplib )
1142+ target_link_libraries (shadps4 PRIVATE stb::headers lfreist-hwinfo::hwinfo nlohmann_json::nlohmann_json miniz::miniz fdk-aac CLI11::CLI11 OpenAL::OpenAL Cpp_Httplib )
1143+
1144+ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" )
1145+ target_link_libraries (shadps4 PRIVATE "/usr/lib/libusb.so" )
1146+ target_link_libraries (shadps4 PRIVATE "/usr/local/lib/libuuid.so" )
1147+ else ()
1148+ target_link_libraries (shadps4 PRIVATE libusb::usb )
1149+ endif ()
11251150
11261151target_compile_definitions (shadps4 PRIVATE IMGUI_USER_CONFIG= "imgui/imgui_config.h" )
11271152target_compile_definitions (Dear_ImGui PRIVATE IMGUI_USER_CONFIG= "${PROJECT_SOURCE_DIR} /src/imgui/imgui_config.h" )
@@ -1167,6 +1192,8 @@ if (APPLE)
11671192
11681193 # Replacement for std::chrono::time_zone
11691194 target_link_libraries (shadps4 PRIVATE date::date-tz epoll-shim )
1195+ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" )
1196+ target_link_libraries (shadps4 PRIVATE date::date-tz epoll-shim )
11701197endif ()
11711198
11721199if (WIN32 )
@@ -1254,3 +1281,8 @@ endif()
12541281
12551282# Install rules
12561283install (TARGETS shadps4 BUNDLE DESTINATION .)
1284+
1285+ else ()
1286+ enable_testing ()
1287+ add_subdirectory (tests )
1288+ endif ()
0 commit comments