From 903dcc6a5b75df174895a5ca70e7e6aaf9a10ad6 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 2 Aug 2024 13:19:59 -0700 Subject: [PATCH] build: use `FindJNI` to locate required headers We use `jni.h` for the android support library. Setup the search in CMake to allow us to find the header and include the header search path properly. --- CMakeLists.txt | 1 + Sources/FirebaseAndroid/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01a2013..87a42eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ project(swift-firebase if(ANDROID) enable_language(C) include(FindJava) + include(FindJNI) include(UseJava) endif() diff --git a/Sources/FirebaseAndroid/CMakeLists.txt b/Sources/FirebaseAndroid/CMakeLists.txt index 675b54f..bf551c1 100644 --- a/Sources/FirebaseAndroid/CMakeLists.txt +++ b/Sources/FirebaseAndroid/CMakeLists.txt @@ -5,7 +5,8 @@ add_library(FirebaseAndroidJNI SHARED target_include_directories(FirebaseAndroidJNI PUBLIC include) target_link_libraries(FirebaseAndroidJNI PRIVATE - log) + log + JNI::JNI) add_jar(SwiftFirebase Native.java