diff options
| author | 2018-01-19 19:36:09 -0500 | |
|---|---|---|
| committer | 2018-01-19 19:36:09 -0500 | |
| commit | c8a094e164b77fdae6b4b8bff7f94b703c24c161 (patch) | |
| tree | 7f1f70cec7f189c022b9ed5dc03c4996d21e54ca | |
| parent | Added CreateSharedMemory & UNIMPLEMENTED() for non existent services. (#113) (diff) | |
| download | yuzu-c8a094e164b77fdae6b4b8bff7f94b703c24c161.tar.gz yuzu-c8a094e164b77fdae6b4b8bff7f94b703c24c161.tar.xz yuzu-c8a094e164b77fdae6b4b8bff7f94b703c24c161.zip | |
Port citra #3352 to yuzu (#103)
* Port citra #3352 to yuzu
This change allows non x86_64 architectures to compile yuzu by skipping the building of dynarmic
* Fixed clang-format errors
* fixes more clang-format errors
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 19 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | src/core/core.cpp | 7 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 10 |
4 files changed, 36 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index aa2154cb1..4b27e0c5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -54,15 +54,18 @@ function(detect_architecture symbol arch) | |||
| 54 | endif() | 54 | endif() |
| 55 | endfunction() | 55 | endfunction() |
| 56 | 56 | ||
| 57 | if (MSVC) | 57 | if (NOT ENABLE_GENERIC) |
| 58 | detect_architecture("_M_AMD64" x86_64) | 58 | if (MSVC) |
| 59 | detect_architecture("_M_IX86" x86) | 59 | detect_architecture("_M_AMD64" x86_64) |
| 60 | detect_architecture("_M_ARM" ARM) | 60 | detect_architecture("_M_IX86" x86) |
| 61 | else() | 61 | detect_architecture("_M_ARM" ARM) |
| 62 | detect_architecture("__x86_64__" x86_64) | 62 | else() |
| 63 | detect_architecture("__i386__" x86) | 63 | detect_architecture("__x86_64__" x86_64) |
| 64 | detect_architecture("__arm__" ARM) | 64 | detect_architecture("__i386__" x86) |
| 65 | detect_architecture("__arm__" ARM) | ||
| 66 | endif() | ||
| 65 | endif() | 67 | endif() |
| 68 | |||
| 66 | if (NOT DEFINED ARCHITECTURE) | 69 | if (NOT DEFINED ARCHITECTURE) |
| 67 | set(ARCHITECTURE "GENERIC") | 70 | set(ARCHITECTURE "GENERIC") |
| 68 | set(ARCHITECTURE_GENERIC 1) | 71 | set(ARCHITECTURE_GENERIC 1) |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 8836ddf63..540d290f2 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | add_library(core STATIC | 1 | add_library(core STATIC |
| 2 | arm/arm_interface.h | 2 | arm/arm_interface.h |
| 3 | arm/dynarmic/arm_dynarmic.cpp | ||
| 4 | arm/dynarmic/arm_dynarmic.h | ||
| 5 | arm/unicorn/arm_unicorn.cpp | 3 | arm/unicorn/arm_unicorn.cpp |
| 6 | arm/unicorn/arm_unicorn.h | 4 | arm/unicorn/arm_unicorn.h |
| 7 | core.cpp | 5 | core.cpp |
| @@ -178,5 +176,13 @@ add_library(core STATIC | |||
| 178 | 176 | ||
| 179 | create_target_directory_groups(core) | 177 | create_target_directory_groups(core) |
| 180 | 178 | ||
| 181 | target_link_libraries(core PUBLIC common PRIVATE dynarmic video_core) | 179 | target_link_libraries(core PUBLIC common PRIVATE video_core) |
| 182 | target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static unicorn) | 180 | target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt lz4_static unicorn) |
| 181 | |||
| 182 | if (ARCHITECTURE_x86_64) | ||
| 183 | target_sources(core PRIVATE | ||
| 184 | arm/dynarmic/arm_dynarmic.cpp | ||
| 185 | arm/dynarmic/arm_dynarmic.h | ||
| 186 | ) | ||
| 187 | target_link_libraries(core PRIVATE dynarmic) | ||
| 188 | endif() | ||
diff --git a/src/core/core.cpp b/src/core/core.cpp index ae1eb2430..0ba44b111 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -5,7 +5,9 @@ | |||
| 5 | #include <memory> | 5 | #include <memory> |
| 6 | #include <utility> | 6 | #include <utility> |
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #ifdef ARCHITECTURE_x86_64 | ||
| 8 | #include "core/arm/dynarmic/arm_dynarmic.h" | 9 | #include "core/arm/dynarmic/arm_dynarmic.h" |
| 10 | #endif | ||
| 9 | #include "core/arm/unicorn/arm_unicorn.h" | 11 | #include "core/arm/unicorn/arm_unicorn.h" |
| 10 | #include "core/core.h" | 12 | #include "core/core.h" |
| 11 | #include "core/core_timing.h" | 13 | #include "core/core_timing.h" |
| @@ -144,7 +146,12 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { | |||
| 144 | break; | 146 | break; |
| 145 | case Settings::CpuCore::Dynarmic: | 147 | case Settings::CpuCore::Dynarmic: |
| 146 | default: | 148 | default: |
| 149 | #ifdef ARCHITECTURE_x86_64 | ||
| 147 | cpu_core = std::make_unique<ARM_Dynarmic>(); | 150 | cpu_core = std::make_unique<ARM_Dynarmic>(); |
| 151 | #else | ||
| 152 | cpu_core = std::make_unique<ARM_Unicorn>(); | ||
| 153 | LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); | ||
| 154 | #endif | ||
| 148 | break; | 155 | break; |
| 149 | } | 156 | } |
| 150 | 157 | ||
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index a613889f0..bea05a09b 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -7,13 +7,16 @@ | |||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "common/file_util.h" | 8 | #include "common/file_util.h" |
| 9 | #include "common/scm_rev.h" | 9 | #include "common/scm_rev.h" |
| 10 | #ifdef ARCHITECTURE_x86_64 | ||
| 10 | #include "common/x64/cpu_detect.h" | 11 | #include "common/x64/cpu_detect.h" |
| 12 | #endif | ||
| 11 | #include "core/core.h" | 13 | #include "core/core.h" |
| 12 | #include "core/settings.h" | 14 | #include "core/settings.h" |
| 13 | #include "core/telemetry_session.h" | 15 | #include "core/telemetry_session.h" |
| 14 | 16 | ||
| 15 | namespace Core { | 17 | namespace Core { |
| 16 | 18 | ||
| 19 | #ifdef ARCHITECTURE_x86_64 | ||
| 17 | static const char* CpuVendorToStr(Common::CPUVendor vendor) { | 20 | static const char* CpuVendorToStr(Common::CPUVendor vendor) { |
| 18 | switch (vendor) { | 21 | switch (vendor) { |
| 19 | case Common::CPUVendor::INTEL: | 22 | case Common::CPUVendor::INTEL: |
| @@ -25,6 +28,7 @@ static const char* CpuVendorToStr(Common::CPUVendor vendor) { | |||
| 25 | } | 28 | } |
| 26 | UNREACHABLE(); | 29 | UNREACHABLE(); |
| 27 | } | 30 | } |
| 31 | #endif | ||
| 28 | 32 | ||
| 29 | static u64 GenerateTelemetryId() { | 33 | static u64 GenerateTelemetryId() { |
| 30 | u64 telemetry_id{}; | 34 | u64 telemetry_id{}; |
| @@ -113,7 +117,8 @@ TelemetrySession::TelemetrySession() { | |||
| 113 | AddField(Telemetry::FieldType::App, "BuildDate", Common::g_build_date); | 117 | AddField(Telemetry::FieldType::App, "BuildDate", Common::g_build_date); |
| 114 | AddField(Telemetry::FieldType::App, "BuildName", Common::g_build_name); | 118 | AddField(Telemetry::FieldType::App, "BuildName", Common::g_build_name); |
| 115 | 119 | ||
| 116 | // Log user system information | 120 | // Log user system information |
| 121 | #ifdef ARCHITECTURE_x86_64 | ||
| 117 | AddField(Telemetry::FieldType::UserSystem, "CPU_Model", Common::GetCPUCaps().cpu_string); | 122 | AddField(Telemetry::FieldType::UserSystem, "CPU_Model", Common::GetCPUCaps().cpu_string); |
| 118 | AddField(Telemetry::FieldType::UserSystem, "CPU_BrandString", | 123 | AddField(Telemetry::FieldType::UserSystem, "CPU_BrandString", |
| 119 | Common::GetCPUCaps().brand_string); | 124 | Common::GetCPUCaps().brand_string); |
| @@ -135,6 +140,9 @@ TelemetrySession::TelemetrySession() { | |||
| 135 | Common::GetCPUCaps().sse4_1); | 140 | Common::GetCPUCaps().sse4_1); |
| 136 | AddField(Telemetry::FieldType::UserSystem, "CPU_Extension_x64_SSE42", | 141 | AddField(Telemetry::FieldType::UserSystem, "CPU_Extension_x64_SSE42", |
| 137 | Common::GetCPUCaps().sse4_2); | 142 | Common::GetCPUCaps().sse4_2); |
| 143 | #else | ||
| 144 | AddField(Telemetry::FieldType::UserSystem, "CPU_Model", "Other"); | ||
| 145 | #endif | ||
| 138 | #ifdef __APPLE__ | 146 | #ifdef __APPLE__ |
| 139 | AddField(Telemetry::FieldType::UserSystem, "OsPlatform", "Apple"); | 147 | AddField(Telemetry::FieldType::UserSystem, "OsPlatform", "Apple"); |
| 140 | #elif defined(_WIN32) | 148 | #elif defined(_WIN32) |