diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c7c48abe..25a5ef57ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,14 +65,16 @@ function(detect_architecture symbol arch) endif() endfunction() -if (MSVC) - detect_architecture("_M_AMD64" x86_64) - detect_architecture("_M_IX86" x86) - detect_architecture("_M_ARM" ARM) -else() - detect_architecture("__x86_64__" x86_64) - detect_architecture("__i386__" x86) - detect_architecture("__arm__" ARM) +if (NOT ENABLE_GENERIC) + if (MSVC) + detect_architecture("_M_AMD64" x86_64) + detect_architecture("_M_IX86" x86) + detect_architecture("_M_ARM" ARM) + else() + detect_architecture("__x86_64__" x86_64) + detect_architecture("__i386__" x86) + detect_architecture("__arm__" ARM) + endif() endif() if (NOT DEFINED ARCHITECTURE) set(ARCHITECTURE "GENERIC") diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 4a4ba11012..88cc525881 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -11,11 +11,13 @@ target_include_directories(catch-single-include INTERFACE catch/single_include) add_subdirectory(cryptopp) # Dynarmic -# Dynarmic will skip defining xbyak if it's already defined, we then define it below -add_library(xbyak INTERFACE) -option(DYNARMIC_TESTS OFF) -set(DYNARMIC_NO_BUNDLED_FMT ON) -add_subdirectory(dynarmic) +if (ARCHITECTURE_x86_64) + # Dynarmic will skip defining xbyak if it's already defined, we then define it below + add_library(xbyak INTERFACE) + option(DYNARMIC_TESTS OFF) + set(DYNARMIC_NO_BUNDLED_FMT ON) + add_subdirectory(dynarmic) +endif() # libfmt add_subdirectory(fmt) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6057b183f6..54df271934 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,10 +1,6 @@ add_library(core STATIC 3ds.h arm/arm_interface.h - arm/dynarmic/arm_dynarmic.cpp - arm/dynarmic/arm_dynarmic.h - arm/dynarmic/arm_dynarmic_cp15.cpp - arm/dynarmic/arm_dynarmic_cp15.h arm/dyncom/arm_dyncom.cpp arm/dyncom/arm_dyncom.h arm/dyncom/arm_dyncom_dec.cpp @@ -404,7 +400,17 @@ add_library(core STATIC create_target_directory_groups(core) target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core) -target_link_libraries(core PUBLIC Boost::boost PRIVATE cryptopp dynarmic fmt) +target_link_libraries(core PUBLIC Boost::boost PRIVATE cryptopp fmt) if (ENABLE_WEB_SERVICE) target_link_libraries(core PUBLIC json-headers web_service) endif() + +if (ARCHITECTURE_x86_64) + target_sources(core PRIVATE + arm/dynarmic/arm_dynarmic.cpp + arm/dynarmic/arm_dynarmic.h + arm/dynarmic/arm_dynarmic_cp15.cpp + arm/dynarmic/arm_dynarmic_cp15.h + ) + target_link_libraries(core PRIVATE dynarmic) +endif() diff --git a/src/core/core.cpp b/src/core/core.cpp index 0c658d1ffe..ad7474ff47 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -7,7 +7,9 @@ #include "audio_core/audio_core.h" #include "common/logging/log.h" #include "core/arm/arm_interface.h" +#ifdef ARCHITECTURE_x86_64 #include "core/arm/dynarmic/arm_dynarmic.h" +#endif #include "core/arm/dyncom/arm_dyncom.h" #include "core/core.h" #include "core/core_timing.h" @@ -147,7 +149,12 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { LOG_DEBUG(HW_Memory, "initialized OK"); if (Settings::values.use_cpu_jit) { +#ifdef ARCHITECTURE_x86_64 cpu_core = std::make_unique(USER32MODE); +#else + cpu_core = std::make_unique(USER32MODE); + LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); +#endif } else { cpu_core = std::make_unique(USER32MODE); } diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index ca517ff447..92abbeb5e0 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -8,7 +8,9 @@ #include "common/assert.h" #include "common/file_util.h" #include "common/scm_rev.h" +#ifdef ARCHITECTURE_x86_64 #include "common/x64/cpu_detect.h" +#endif #include "core/core.h" #include "core/settings.h" #include "core/telemetry_session.h" @@ -20,6 +22,7 @@ namespace Core { +#ifdef ARCHITECTURE_x86_64 static const char* CpuVendorToStr(Common::CPUVendor vendor) { switch (vendor) { case Common::CPUVendor::INTEL: @@ -31,6 +34,7 @@ static const char* CpuVendorToStr(Common::CPUVendor vendor) { } UNREACHABLE(); } +#endif static u64 GenerateTelemetryId() { u64 telemetry_id{}; @@ -121,7 +125,8 @@ TelemetrySession::TelemetrySession() { AddField(Telemetry::FieldType::App, "BuildDate", Common::g_build_date); AddField(Telemetry::FieldType::App, "BuildName", Common::g_build_name); - // Log user system information +// Log user system information +#ifdef ARCHITECTURE_x86_64 AddField(Telemetry::FieldType::UserSystem, "CPU_Model", Common::GetCPUCaps().cpu_string); AddField(Telemetry::FieldType::UserSystem, "CPU_BrandString", Common::GetCPUCaps().brand_string); @@ -143,6 +148,9 @@ TelemetrySession::TelemetrySession() { Common::GetCPUCaps().sse4_1); AddField(Telemetry::FieldType::UserSystem, "CPU_Extension_x64_SSE42", Common::GetCPUCaps().sse4_2); +#else + AddField(Telemetry::FieldType::UserSystem, "CPU_Model", "Other"); +#endif #ifdef __APPLE__ AddField(Telemetry::FieldType::UserSystem, "OsPlatform", "Apple"); #elif defined(_WIN32)