Skip to content

Commit 25ccc9f

Browse files
authored
Avoid unused thread_id warning and recompile multi-module sample (#3033)
- Unused variable warning (when building in release mode): ```bash wasm-micro-runtime/samples/wasi-threads/wasm-apps/no_pthread.c:44:9: warning: variable 'thread_id' set but not used [-Wunused-but-set-variable] int thread_id; ``` - When using the multi-module example and changing the files in `wasm-apps`, they don't get recompiled when the sample is rebuilt. Adding `BUILD_ALWAYS` as it's done in other samples.
1 parent 7b6d0a5 commit 25ccc9f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

samples/multi-module/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ endif()
132132
# .c -> .wasm
133133
ExternalProject_Add(WASM_MODULE
134134
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps
135+
BUILD_ALWAYS TRUE
135136
UPDATE_COMMAND ""
136137
PATCH_COMMAND ""
137138
CONFIGURE_COMMAND ${CMAKE_COMMAND}

samples/wasi-threads/wasm-apps/wasi_thread_start.h

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
/* See https://github.com/WebAssembly/wasi-threads#design-choice-thread-ids */
1111
#define ASSERT_VALID_TID(TID) \
12+
(void)TID; \
1213
assert(TID >= 1 && TID <= 0x1FFFFFFF && "Invalid thread ID")
1314

1415
typedef struct {

0 commit comments

Comments
 (0)