Skip to content

Commit

Permalink
Avoid unused thread_id warning and recompile multi-module sample (byt…
Browse files Browse the repository at this point in the history
…ecodealliance#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.
  • Loading branch information
eloparco authored Jan 17, 2024
1 parent 7b6d0a5 commit 25ccc9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/multi-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ endif()
# .c -> .wasm
ExternalProject_Add(WASM_MODULE
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps
BUILD_ALWAYS TRUE
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ${CMAKE_COMMAND}
Expand Down
1 change: 1 addition & 0 deletions samples/wasi-threads/wasm-apps/wasi_thread_start.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

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

typedef struct {
Expand Down

0 comments on commit 25ccc9f

Please sign in to comment.