Skip to content

Commit 370bb9d

Browse files
committed
Refactor sample build and test steps in SGX compilation workflow for improved clarity and efficiency (workaround)
1 parent 4630587 commit 370bb9d

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.github/workflows/compilation_on_sgx.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -223,34 +223,31 @@ jobs:
223223
- name: Build wamrc only for testing samples in aot mode
224224
if: matrix.iwasm_make_options_run_mode == '$AOT_BUILD_OPTIONS'
225225
run: |
226-
mkdir build && cd build
227-
cmake ..
228-
cmake --build . --config Release --parallel 4
229-
cp wamrc `pwd`/../../product-mini/platforms/${{ matrix.platform }}/enclave-sample
226+
cmake -S . -B build
227+
cmake --build build --config Release --parallel 4
228+
cp build/wamrc ../product-mini/platforms/${{ matrix.platform }}/enclave-sample
230229
working-directory: wamr-compiler
231230

232-
# cmake --build . --config Debug --parallel 4
233231
- name: Build Sample [file]
234232
run: |
235-
cd samples/file
236-
mkdir build && cd build
237-
cmake ..
238-
cmake --build . --config Debug --verbose
239-
cp wasm-app/file.wasm `pwd`/../../../product-mini/platforms/${{ matrix.platform }}/enclave-sample
233+
cmake -S . -B build
234+
cmake --build build --config Debug --parallel 4
235+
cp build/wasm-app/file.wasm ../../product-mini/platforms/${{ matrix.platform }}/enclave-sample
236+
working-directory: samples/file
240237

241238
- name: Test Sample [file] in non-aot mode
242239
if: matrix.iwasm_make_options_run_mode != '$AOT_BUILD_OPTIONS'
243240
run: |
244241
source /opt/intel/sgxsdk/environment
245-
./iwasm -f file.wasm -d .
242+
./iwasm --dir=. ./file.wasm
246243
working-directory: product-mini/platforms/${{ matrix.platform }}/enclave-sample
247244

248245
- name: Test Sample [file] in aot mode
249246
if: matrix.iwasm_make_options_run_mode == '$AOT_BUILD_OPTIONS'
250247
run: |
251248
source /opt/intel/sgxsdk/environment
252-
./wamrc -sgx -o file.aot file.wasm
253-
./iwasm -f file.aot -d .
249+
./wamrc -sgx -o ./file.aot ./file.wasm
250+
./iwasm --dir=. ./file.aot
254251
working-directory: product-mini/platforms/${{ matrix.platform }}/enclave-sample
255252

256253
spec_test_default:

product-mini/platforms/linux-sgx/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ if (NOT DEFINED WAMR_BUILD_STATIC_PGO)
9898
set (WAMR_BUILD_STATIC_PGO 0)
9999
endif ()
100100

101+
if (NOT DEFINED WAMR_BUILD_REF_TYPES)
102+
# Enable reference types by default
103+
set (WAMR_BUILD_REF_TYPES 1)
104+
endif ()
105+
101106
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
102107
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -ffunction-sections -fdata-sections \
103108
-Wall -Wno-unused-parameter -Wno-pedantic \

0 commit comments

Comments
 (0)