cmake : include the llguidance header from the source tree (#32928)

Cargo 1.100 changed the build directory layout for intermediate artifacts, so
the header destination llguidance derives from $OUT_DIR no longer resolves to
target/release, and the build fails on a missing llguidance.h. The header is a
source file that cargo only copies around, so include it from the llguidance
source tree instead of from the build output.

ref: https://github.com/rust-lang/cargo/pull/17354

Assisted-by: dsh:llama.cpp/ggml-org/Qwen3.8-Flash-Next-GGUF (MacBook, M5 Max, 128GB)
This commit is contained in:
Georgi Gerganov 2026-11-24 20:31:24 +02:00 • committed by GitHub
parent dbaf582af4
commit bb692efaa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -171,7 +171,7 @@ if (LLAMA_LLGUIDANCE)
CONFIGURE_COMMAND ""
BUILD_COMMAND cargo build --release --package llguidance
INSTALL_COMMAND ""
BUILD_BYPRODUCTS ${LLGUIDANCE_PATH}/${LLGUIDANCE_LIB_NAME} ${LLGUIDANCE_PATH}/llguidance.h
BUILD_BYPRODUCTS ${LLGUIDANCE_PATH}/${LLGUIDANCE_LIB_NAME} ${LLGUIDANCE_SRC}/parser/llguidance.h
UPDATE_COMMAND ""
)
target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_LLGUIDANCE)
@ -180,7 +180,7 @@ if (LLAMA_LLGUIDANCE)
set_target_properties(llguidance PROPERTIES IMPORTED_LOCATION ${LLGUIDANCE_PATH}/${LLGUIDANCE_LIB_NAME})
add_dependencies(llguidance llguidance_ext)
target_include_directories(${TARGET} PRIVATE ${LLGUIDANCE_PATH})
target_include_directories(${TARGET} PRIVATE ${LLGUIDANCE_SRC}/parser)
target_link_libraries(${TARGET} PRIVATE llguidance)
if (WIN32)
target_link_libraries(${TARGET} PRIVATE ws2_32 userenv ntdll bcrypt)