Skip to content

Commit c9fd44e

Browse files
authored
Build samples in debug mode (#3019)
Follow-up on #3008. Compiling samples in Debug mode allows us to take advantage of asserts and would have prevented the fix in #3008.
1 parent 685d55d commit c9fd44e

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
run: |
323323
VERBOSE=1
324324
cmake -S . -B build ${{ matrix.make_options }}
325-
cmake --build build --config Release --parallel 4
325+
cmake --build build --config Debug --parallel 4
326326
ctest --test-dir build --output-on-failure
327327
working-directory: samples/wasm-c-api
328328

@@ -393,23 +393,23 @@ jobs:
393393
cd samples/file
394394
mkdir build && cd build
395395
cmake ..
396-
cmake --build . --config Release --parallel 4
396+
cmake --build . --config Debug --parallel 4
397397
./src/iwasm -f wasm-app/file.wasm -d .
398398
399399
- name: Build Sample [multi-thread]
400400
run: |
401401
cd samples/multi-thread
402402
mkdir build && cd build
403403
cmake ..
404-
cmake --build . --config Release --parallel 4
404+
cmake --build . --config Debug --parallel 4
405405
./iwasm wasm-apps/test.wasm
406406
407407
- name: Build Sample [multi-module]
408408
run: |
409409
cd samples/multi-module
410410
mkdir build && cd build
411411
cmake .. -DWAMR_BUILD_AOT=1
412-
cmake --build . --config Release --parallel 4
412+
cmake --build . --config Debug --parallel 4
413413
./multi_module mC.wasm
414414
./multi_module mC.aot
415415
@@ -418,15 +418,15 @@ jobs:
418418
cd samples/spawn-thread
419419
mkdir build && cd build
420420
cmake ..
421-
cmake --build . --config Release --parallel 4
421+
cmake --build . --config Debug --parallel 4
422422
./spawn_thread
423423
424424
- name: Build Sample [ref-types]
425425
run: |
426426
cd samples/ref-types
427427
mkdir build && cd build
428428
cmake ..
429-
cmake --build . --config Release --parallel 4
429+
cmake --build . --config Debug --parallel 4
430430
./hello
431431
432432
- name: Build Sample [simple]
@@ -441,7 +441,7 @@ jobs:
441441
cd samples/wasi-threads
442442
mkdir build && cd build
443443
cmake ..
444-
cmake --build . --config Release --parallel 4
444+
cmake --build . --config Debug --parallel 4
445445
./iwasm wasm-apps/no_pthread.wasm
446446
447447
- name: Build Sample [shared-module]

.github/workflows/compilation_on_macos.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,47 +285,47 @@ jobs:
285285
cd samples/file
286286
mkdir build && cd build
287287
cmake ..
288-
cmake --build . --config Release --parallel 4
288+
cmake --build . --config Debug --parallel 4
289289
./src/iwasm -f wasm-app/file.wasm -d .
290290
291291
- name: Build Sample [multi-thread]
292292
run: |
293293
cd samples/multi-thread
294294
mkdir build && cd build
295295
cmake ..
296-
cmake --build . --config Release --parallel 4
296+
cmake --build . --config Debug --parallel 4
297297
./iwasm wasm-apps/test.wasm
298298
299299
- name: Build Sample [multi-module]
300300
run: |
301301
cd samples/multi-module
302302
mkdir build && cd build
303303
cmake ..
304-
cmake --build . --config Release --parallel 4
304+
cmake --build . --config Debug --parallel 4
305305
./multi_module mC.wasm
306306
307307
- name: Build Sample [spawn-thread]
308308
run: |
309309
cd samples/spawn-thread
310310
mkdir build && cd build
311311
cmake ..
312-
cmake --build . --config Release --parallel 4
312+
cmake --build . --config Debug --parallel 4
313313
./spawn_thread
314314
315315
- name: Build Sample [ref-types]
316316
run: |
317317
cd samples/ref-types
318318
mkdir build && cd build
319319
cmake ..
320-
cmake --build . --config Release --parallel 4
320+
cmake --build . --config Debug --parallel 4
321321
./hello
322322
323323
- name: Build Sample [wasi-threads]
324324
run: |
325325
cd samples/wasi-threads
326326
mkdir build && cd build
327327
cmake ..
328-
cmake --build . --config Release --parallel 4
328+
cmake --build . --config Debug --parallel 4
329329
./iwasm wasm-apps/no_pthread.wasm
330330
331331
- name: Build Sample [shared-module]

.github/workflows/compilation_on_sgx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ jobs:
246246
cd samples/file
247247
mkdir build && cd build
248248
cmake ..
249-
cmake --build . --config Release --parallel 4
249+
cmake --build . --config Debug --parallel 4
250250
cp wasm-app/file.wasm `pwd`/../../../product-mini/platforms/${{ matrix.platform }}/enclave-sample
251251
252252
- name: Test Sample [file] in non-aot mode

samples/basic/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "#####################build basic project"
2121
cd ${CURR_DIR}
2222
mkdir -p cmake_build
2323
cd cmake_build
24-
cmake ..
24+
cmake .. -DCMAKE_BUILD_TYPE=Debug
2525
make -j ${nproc}
2626
if [ $? != 0 ];then
2727
echo "BUILD_FAIL basic exit as $?\n"

samples/shared-module/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "##################### build shared-module project"
2121
cd ${CURR_DIR}
2222
mkdir -p cmake_build
2323
cd cmake_build
24-
cmake ..
24+
cmake .. -DCMAKE_BUILD_TYPE=Debug
2525
make -j ${nproc}
2626
if [ $? != 0 ];then
2727
echo "BUILD_FAIL shared-module exit as $?\n"

samples/simple/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ APP_LIB_SRC="${APP_FRAMEWORK_DIR}/base/app/*.c ${APP_FRAMEWORK_DIR}/sensor/app/*
1717
${APP_FRAMEWORK_DIR}/connection/app/*.c ${NATIVE_LIBS}/*.c"
1818
WASM_APPS=${PWD}/wasm-apps
1919
CLEAN=
20-
CM_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release"
20+
CM_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug"
2121
CM_TOOLCHAIN=""
2222

2323
usage ()

0 commit comments

Comments
 (0)