Skip to content

Commit 8a6f68f

Browse files
committed
Find only JVM component of JNI in CMake 3.24+ by @cavallium.
1 parent 515c585 commit 8a6f68f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ target_link_libraries(tdapi PRIVATE tdutils)
923923

924924
if (TD_ENABLE_JNI AND NOT ANDROID) # jni is available by default on Android
925925
if (NOT JNI_FOUND)
926-
find_package(JNI REQUIRED)
926+
find_package(JNI REQUIRED COMPONENTS JVM)
927927
endif()
928928
message(STATUS "Found JNI: ${JNI_INCLUDE_DIRS} ${JNI_LIBRARIES}")
929929
target_include_directories(tdapi PUBLIC ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})

‎example/java/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ endif()
2424
find_package(Td REQUIRED)
2525

2626
if (NOT JNI_FOUND)
27-
find_package(JNI REQUIRED)
27+
find_package(JNI REQUIRED COMPONENTS JVM)
2828
endif()
2929
message(STATUS "Found JNI: ${JNI_INCLUDE_DIRS} ${JNI_LIBRARIES}")
3030

0 commit comments

Comments
 (0)