From e5a3dc2956428d5a0a65e30ffd666d845db9d286 Mon Sep 17 00:00:00 2001
From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Date: Mon, 8 Jan 2018 17:58:24 +0100
Subject: [PATCH] Core: Disable the JIT when dynarmic is not available

---
 src/core/CMakeLists.txt | 2 +-
 src/core/core.cpp       | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index f6d6fd3d4..54df27193 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -406,7 +406,7 @@ if (ENABLE_WEB_SERVICE)
 endif()
 
 if (ARCHITECTURE_x86_64)
-    add_library(core STATIC
+    target_sources(core PRIVATE
         arm/dynarmic/arm_dynarmic.cpp
         arm/dynarmic/arm_dynarmic.h
         arm/dynarmic/arm_dynarmic_cp15.cpp
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 0c658d1ff..ad7474ff4 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<ARM_Dynarmic>(USER32MODE);
+#else
+        cpu_core = std::make_unique<ARM_DynCom>(USER32MODE);
+        LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");
+#endif
     } else {
         cpu_core = std::make_unique<ARM_DynCom>(USER32MODE);
     }