Skip to content

Commit 9fcf466

Browse files
committed
fix(cmake): point bundled JNI headers to repo-root .github/include after the llama/ move
The C++ compile failed on every native job with `fatal error: jni.h: No such file or directory`. The bundled JNI headers live in .github/include/ at the repo ROOT, but CMakeLists.txt now runs inside the llama/ module, so the relative `.github/include/unix` resolved to the non-existent llama/.github/include/unix. Anchor it to ${CMAKE_CURRENT_SOURCE_DIR}/../.github/include/{unix,windows} so it points at the repo root regardless of build CWD. Covers Linux, macOS and Windows (all use the bundled headers). The other CMakeLists paths use ${CMAKE_SOURCE_DIR}/… which already resolves inside llama/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rt1paYztGJ2AKUuBuAGDXE
1 parent 2d592da commit 9fcf466

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

llama/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,13 @@ endif()
277277

278278
# include jni.h and jni_md.h
279279
if(NOT DEFINED JNI_INCLUDE_DIRS)
280+
# The bundled JNI headers live in .github/include/ at the REPO ROOT, one level above
281+
# this module (the core moved into llama/). Anchor to the parent of the CMake source
282+
# dir so the path is correct regardless of the build CWD.
280283
if(OS_NAME MATCHES "^Linux" OR OS_NAME STREQUAL "Mac" OR OS_NAME STREQUAL "Darwin")
281-
set(JNI_INCLUDE_DIRS .github/include/unix)
284+
set(JNI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../.github/include/unix)
282285
elseif(OS_NAME STREQUAL "Windows")
283-
set(JNI_INCLUDE_DIRS .github/include/windows)
286+
set(JNI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../.github/include/windows)
284287
# if we don't have provided headers, try to find them via Java
285288
else()
286289
find_package(Java REQUIRED)

0 commit comments

Comments
 (0)