From 8cd6d2b5c129bd6ff7931c1f501d26caf9611e98 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 31 Aug 2026 00:53:55 +0000 Subject: [PATCH 1/2] Update llama.cpp submodule to 9723942 --- deps/llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/llama.cpp b/deps/llama.cpp index 389ff61..9723942 160000 --- a/deps/llama.cpp +++ b/deps/llama.cpp @@ -1 +1 @@ -Subproject commit 389ff61d77b5c71cec0cf92fe4e5d01ace80b797 +Subproject commit 9723942adc518b43c4b95dc4dce6906903eb5e09 From cc1e4d3bd0e38259235870d330ec1cf5bf4fa190 Mon Sep 17 00:00:00 2001 From: daavoo Date: Mon, 31 Aug 2026 10:19:31 +0200 Subject: [PATCH 2/2] fix: Adapt to llama.cpp renaming its `common` target to `llama-common` Upstream llama.cpp moved its vendored headers behind `vendor::*` interface targets and renamed the `common` library to `llama-common`. Linking the now-nonexistent `common` target silently degraded to `-lcommon`, so the nlohmann include directory was no longer propagated and every target that includes failed to compile. Resolve the target name once (falling back to `common` for older pins) and use it everywhere, including the standalone example projects. Co-Authored-By: Claude Opus 5 (1M context) --- CMakeLists.txt | 39 +++++++++++++-------- examples/context-engineering/CMakeLists.txt | 2 +- examples/grammar/CMakeLists.txt | 2 +- examples/mcp/CMakeLists.txt | 2 +- examples/memory/CMakeLists.txt | 2 +- examples/multi-agent/CMakeLists.txt | 2 +- examples/shell/CMakeLists.txt | 2 +- examples/tracing/CMakeLists.txt | 2 +- 8 files changed, 32 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6636064..ef46696 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,20 @@ if(AGENT_CPP_BUNDLED_LLAMA) set(LLAMA_LLGUIDANCE OFF CACHE BOOL "" FORCE) add_subdirectory(${LLAMA_SOURCE_DIR} ${CMAKE_BINARY_DIR}/llama.cpp) + + # Recent llama.cpp renamed the `common` target to `llama-common`. + # Support both so older pinned versions keep working. Cached so that the + # standalone example projects (which add this directory as a subdirectory) + # can use it too. + if(TARGET llama-common) + set(LLAMA_COMMON_TARGET llama-common CACHE INTERNAL "llama.cpp common target name") + else() + set(LLAMA_COMMON_TARGET common CACHE INTERNAL "llama.cpp common target name") + endif() else() # Use system-installed llama.cpp find_package(llama REQUIRED) + set(LLAMA_COMMON_TARGET common CACHE INTERNAL "llama.cpp common target name") message(STATUS "Using system-installed llama.cpp") endif() @@ -58,7 +69,7 @@ target_include_directories(model $ $ ) -target_link_libraries(model PUBLIC common llama) +target_link_libraries(model PUBLIC ${LLAMA_COMMON_TARGET} llama) target_compile_features(model PUBLIC cxx_std_17) add_library(agent STATIC src/agent.cpp) @@ -72,7 +83,7 @@ target_include_directories(agent $ $ ) -target_link_libraries(agent PUBLIC model common llama) +target_link_libraries(agent PUBLIC model ${LLAMA_COMMON_TARGET} llama) target_compile_features(agent PUBLIC cxx_std_17) # MCP Client library for connecting to MCP servers via HTTP @@ -93,7 +104,7 @@ if(AGENT_CPP_BUILD_MCP) $ $ ) - target_link_libraries(mcp_client PUBLIC common OpenSSL::SSL OpenSSL::Crypto) + target_link_libraries(mcp_client PUBLIC ${LLAMA_COMMON_TARGET} OpenSSL::SSL OpenSSL::Crypto) target_compile_features(mcp_client PUBLIC cxx_std_17) message(STATUS "MCP client enabled (using cpp-httplib)") @@ -117,7 +128,7 @@ if(AGENT_CPP_BUILD_OAUTH) $ $ ) - target_link_libraries(oauth PUBLIC common OpenSSL::SSL OpenSSL::Crypto) + target_link_libraries(oauth PUBLIC ${LLAMA_COMMON_TARGET} OpenSSL::SSL OpenSSL::Crypto) target_compile_features(oauth PUBLIC cxx_std_17) message(STATUS "OAuth client enabled (using cpp-httplib)") @@ -128,7 +139,7 @@ if(AGENT_CPP_BUILD_TESTS) add_executable(test_tool tests/test_tool.cpp) target_include_directories(test_tool PRIVATE src tests) - target_link_libraries(test_tool PRIVATE common llama) + target_link_libraries(test_tool PRIVATE ${LLAMA_COMMON_TARGET} llama) target_compile_features(test_tool PRIVATE cxx_std_17) add_executable(test_grammar tests/test_grammar.cpp) @@ -140,7 +151,7 @@ if(AGENT_CPP_BUILD_TESTS) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(test_grammar PRIVATE model common llama) + target_link_libraries(test_grammar PRIVATE model ${LLAMA_COMMON_TARGET} llama) target_compile_features(test_grammar PRIVATE cxx_std_17) add_executable(test_callbacks tests/test_callbacks.cpp) @@ -152,7 +163,7 @@ if(AGENT_CPP_BUILD_TESTS) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(test_callbacks PRIVATE agent model common llama) + target_link_libraries(test_callbacks PRIVATE agent model ${LLAMA_COMMON_TARGET} llama) target_compile_features(test_callbacks PRIVATE cxx_std_17) add_test(NAME ToolTests COMMAND test_tool) @@ -166,7 +177,7 @@ if(AGENT_CPP_BUILD_TESTS) tests ${LLAMA_SOURCE_DIR}/common ) - target_link_libraries(test_mcp_client PRIVATE mcp_client common) + target_link_libraries(test_mcp_client PRIVATE mcp_client ${LLAMA_COMMON_TARGET}) target_compile_features(test_mcp_client PRIVATE cxx_std_17) add_test(NAME MCPClientTests COMMAND test_mcp_client) @@ -194,7 +205,7 @@ if(AGENT_CPP_BUILD_EXAMPLES) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(shell-example PRIVATE agent model common llama) + target_link_libraries(shell-example PRIVATE agent model ${LLAMA_COMMON_TARGET} llama) target_compile_features(shell-example PRIVATE cxx_std_17) # Memory example @@ -207,7 +218,7 @@ if(AGENT_CPP_BUILD_EXAMPLES) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(memory-example PRIVATE agent model common llama) + target_link_libraries(memory-example PRIVATE agent model ${LLAMA_COMMON_TARGET} llama) target_compile_features(memory-example PRIVATE cxx_std_17) # Multi-agent example @@ -220,7 +231,7 @@ if(AGENT_CPP_BUILD_EXAMPLES) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(multi-agent-example PRIVATE agent model common llama) + target_link_libraries(multi-agent-example PRIVATE agent model ${LLAMA_COMMON_TARGET} llama) target_compile_features(multi-agent-example PRIVATE cxx_std_17) # Context engineering example @@ -233,7 +244,7 @@ if(AGENT_CPP_BUILD_EXAMPLES) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(context-engineering-example PRIVATE agent model common llama) + target_link_libraries(context-engineering-example PRIVATE agent model ${LLAMA_COMMON_TARGET} llama) target_compile_features(context-engineering-example PRIVATE cxx_std_17) # Grammar example @@ -246,7 +257,7 @@ if(AGENT_CPP_BUILD_EXAMPLES) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(grammar-example PRIVATE agent model common llama) + target_link_libraries(grammar-example PRIVATE agent model ${LLAMA_COMMON_TARGET} llama) target_compile_features(grammar-example PRIVATE cxx_std_17) # MCP client example (requires MCP support) @@ -260,7 +271,7 @@ if(AGENT_CPP_BUILD_EXAMPLES) ${LLAMA_SOURCE_DIR}/include ${LLAMA_SOURCE_DIR}/vendor ) - target_link_libraries(mcp-example PRIVATE agent model mcp_client common llama) + target_link_libraries(mcp-example PRIVATE agent model mcp_client ${LLAMA_COMMON_TARGET} llama) target_compile_features(mcp-example PRIVATE cxx_std_17) endif() diff --git a/examples/context-engineering/CMakeLists.txt b/examples/context-engineering/CMakeLists.txt index e73e0e8..8c51724 100644 --- a/examples/context-engineering/CMakeLists.txt +++ b/examples/context-engineering/CMakeLists.txt @@ -18,7 +18,7 @@ target_include_directories(context-engineering-example PRIVATE ${LLAMA_SOURCE_DIR}/vendor ) -target_link_libraries(context-engineering-example PRIVATE agent-cpp::agent common llama) +target_link_libraries(context-engineering-example PRIVATE agent-cpp::agent ${LLAMA_COMMON_TARGET} llama) target_compile_features(context-engineering-example PRIVATE cxx_std_17) message(STATUS "Context engineering example configured.") diff --git a/examples/grammar/CMakeLists.txt b/examples/grammar/CMakeLists.txt index 799e40f..1f38961 100644 --- a/examples/grammar/CMakeLists.txt +++ b/examples/grammar/CMakeLists.txt @@ -18,7 +18,7 @@ target_include_directories(grammar-example PRIVATE ${LLAMA_SOURCE_DIR}/vendor ) -target_link_libraries(grammar-example PRIVATE agent-cpp::agent common llama) +target_link_libraries(grammar-example PRIVATE agent-cpp::agent ${LLAMA_COMMON_TARGET} llama) target_compile_features(grammar-example PRIVATE cxx_std_17) message(STATUS "Grammar example configured.") diff --git a/examples/mcp/CMakeLists.txt b/examples/mcp/CMakeLists.txt index 4cc8dc1..f50604b 100644 --- a/examples/mcp/CMakeLists.txt +++ b/examples/mcp/CMakeLists.txt @@ -20,7 +20,7 @@ target_include_directories(mcp-example PRIVATE ${LLAMA_SOURCE_DIR}/vendor ) -target_link_libraries(mcp-example PRIVATE agent mcp_client common llama) +target_link_libraries(mcp-example PRIVATE agent mcp_client ${LLAMA_COMMON_TARGET} llama) target_compile_features(mcp-example PRIVATE cxx_std_17) message(STATUS "MCP example configured.") diff --git a/examples/memory/CMakeLists.txt b/examples/memory/CMakeLists.txt index 8c23822..56bbfe5 100644 --- a/examples/memory/CMakeLists.txt +++ b/examples/memory/CMakeLists.txt @@ -18,7 +18,7 @@ target_include_directories(memory-example PRIVATE ${LLAMA_SOURCE_DIR}/vendor ) -target_link_libraries(memory-example PRIVATE agent-cpp::agent common llama) +target_link_libraries(memory-example PRIVATE agent-cpp::agent ${LLAMA_COMMON_TARGET} llama) target_compile_features(memory-example PRIVATE cxx_std_17) message(STATUS "Memory as tool example configured.") diff --git a/examples/multi-agent/CMakeLists.txt b/examples/multi-agent/CMakeLists.txt index 26678f6..f557d26 100644 --- a/examples/multi-agent/CMakeLists.txt +++ b/examples/multi-agent/CMakeLists.txt @@ -18,7 +18,7 @@ target_include_directories(multi-agent-example PRIVATE ${LLAMA_SOURCE_DIR}/vendor ) -target_link_libraries(multi-agent-example PRIVATE agent-cpp::agent common llama) +target_link_libraries(multi-agent-example PRIVATE agent-cpp::agent ${LLAMA_COMMON_TARGET} llama) target_compile_features(multi-agent-example PRIVATE cxx_std_17) message(STATUS "Multi-agent example configured.") diff --git a/examples/shell/CMakeLists.txt b/examples/shell/CMakeLists.txt index 82d879b..ff25f10 100644 --- a/examples/shell/CMakeLists.txt +++ b/examples/shell/CMakeLists.txt @@ -18,7 +18,7 @@ target_include_directories(shell-example PRIVATE ${LLAMA_SOURCE_DIR}/vendor ) -target_link_libraries(shell-example PRIVATE agent-cpp::agent common llama) +target_link_libraries(shell-example PRIVATE agent-cpp::agent ${LLAMA_COMMON_TARGET} llama) target_compile_features(shell-example PRIVATE cxx_std_17) message(STATUS "Shell tool example configured.") diff --git a/examples/tracing/CMakeLists.txt b/examples/tracing/CMakeLists.txt index 6fbf9b4..69bb7ae 100644 --- a/examples/tracing/CMakeLists.txt +++ b/examples/tracing/CMakeLists.txt @@ -62,7 +62,7 @@ target_include_directories(tracing-example PRIVATE target_link_libraries(tracing-example PRIVATE agent-cpp::agent - common + ${LLAMA_COMMON_TARGET} llama opentelemetry_trace opentelemetry_exporter_otlp_http