From d28ead1438941026f9ed94d8110e82a2a8442196 Mon Sep 17 00:00:00 2001
From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
Date: Tue, 26 Dec 2023 20:29:07 +0200
Subject: [PATCH] Ignore JNI driver files for Android Hydra core

---
 CMakeLists.txt           | 3 ++-
 src/core/loader/ncch.cpp | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b0410fd..ef26e401 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -388,9 +388,10 @@ if(ENABLE_VULKAN)
     set(ALL_SOURCES ${ALL_SOURCES} ${RENDERER_VK_SOURCE_FILES})
 endif()
 
-if(ANDROID)
+if(ANDROID AND NOT BUILD_HYDRA_CORE)
     set(HEADER_FILES ${HEADER_FILES} include/jni_driver.hpp)
     set(ALL_SOURCES ${ALL_SOURCES} src/jni_driver.cpp)
+    target_compile_definitions(Alber PRIVATE PANDA3DS_FRONTEND_PANDROID=1)
 endif()
 
 if(BUILD_HYDRA_CORE)
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index a294f0e6..ac1eb629 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -259,7 +259,8 @@ bool NCCH::parseSMDH(const std::vector<u8>& smdh) {
 		return false;
 	}
 
-#ifdef __ANDROID__
+	// In the Android version, notify the application that we're loading an SMDH file, to extract data for the title list
+#ifdef PANDA3DS_FRONTEND_PANDROID
 	Pandroid::onSmdhLoaded(smdh);
 #endif