From 1425911ffa307a6ca4d4dd73948692a3c727f74a Mon Sep 17 00:00:00 2001 From: TianlongLiang Date: Tue, 7 Apr 2026 15:28:38 +0800 Subject: [PATCH] fix compile error for higher version Zephyr --- .../zephyr/user-mode/lib-wamr-zephyr/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/product-mini/platforms/zephyr/user-mode/lib-wamr-zephyr/CMakeLists.txt b/product-mini/platforms/zephyr/user-mode/lib-wamr-zephyr/CMakeLists.txt index 347fddf3e..a4c771e22 100644 --- a/product-mini/platforms/zephyr/user-mode/lib-wamr-zephyr/CMakeLists.txt +++ b/product-mini/platforms/zephyr/user-mode/lib-wamr-zephyr/CMakeLists.txt @@ -57,6 +57,13 @@ zephyr_library_sources ( wamr_lib.c ) +# Ensure generated headers (e.g. heap_constants.h) are ready before compiling +# the library. Zephyr adds this dependency for its own libraries automatically, +# but parallel builds can race when the library is added via add_subdirectory. +if(TARGET zephyr_generated_headers) + add_dependencies(wamr_lib zephyr_generated_headers) +endif() + # Specify the memory partition where all globals(including the WAMR global heap buffer) # in the library should be placed. This partition will be defined in the app source code # and added to the use-mode thread that uses the WAMR library.