From 58cec7d5c96b874119f24ec9eaf04029d0d59985 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Wed, 11 Mar 2026 22:26:38 +0100 Subject: [PATCH] fix: make demo container building optional via cmake option Add OCRE_BUILD_DEMO_CONTAINERS option (default ON) to control whether demo_containers.cmake is included. This allows building the Ocre runtime on platforms where WASI SDK is not available (e.g. riscv64), by passing -DOCRE_BUILD_DEMO_CONTAINERS=OFF. The demo containers require the ocre-sdk submodule which uses WASI SDK to compile C to WebAssembly. WASI SDK ships pre-built binaries for x86_64 and arm64 only, so the demo build fails on other architectures. The runtime itself (ocre_mini, ocre_demo, ocre_cmd) builds and runs correctly on riscv64 without this dependency. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Bruno Verachten --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a6e464b..c90b6ba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,11 @@ set(CMAKE_C_STANDARD 99) set(WAMR_BUILD_PLATFORM linux) -include (src/samples/demo/demo_containers.cmake) +option(OCRE_BUILD_DEMO_CONTAINERS "Build demo containers from ocre-sdk (requires WASI SDK)" ON) + +if(OCRE_BUILD_DEMO_CONTAINERS) + include (src/samples/demo/demo_containers.cmake) +endif() # uthash add_subdirectory(src/uthash)