Skip to content

Commit 904edfd

Browse files
committed
MDEV-25777: JAVA_INCLUDE_PATH and JAVA_INCLUDE_PATH2 not found with out of source configuration and Ninja generator
- As solution `PLUGIN_CONNECT=NO` use early check to disable plugin: Solution suggested by wlad@mariadb.com - `JNI_FOUND` is a internal result variable and should be set with cached library and header variables (like `JAVA_INCLUDE_PATH`) defined. * Note: wrapper cmake/FindJNI.cmake runs first time and cmake native Find<module> returns only cached variable, like `JAVA_INCLUDE_PATH`, results variable are not cached). Reviewed by: serg@mariadb.com
1 parent 2274c4f commit 904edfd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmake/FindJNI.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if(JAVA_AWT_LIBRARY)
1+
if(JAVA_AWT_LIBRARY AND JAVA_INCLUDE_PATH)
22
set(JNI_FOUND TRUE)
33
return()
44
endif()

storage/connect/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
1515

16+
IF(WITHOUT_DYNAMIC_PLUGINS OR WITH_NONE OR ("${PLUGIN_CONNECT}" STREQUAL "NO"))
17+
RETURN()
18+
ENDIF()
19+
1620
SET(CONNECT_PLUGIN_STATIC "connect")
1721
SET(CONNECT_PLUGIN_DYNAMIC "connect")
1822

0 commit comments

Comments
 (0)