Skip to content

Commit

Permalink
use build for llvm libraries build diretory for all platform, conditi…
Browse files Browse the repository at this point in the history
…onally set multi-line separator in CI
  • Loading branch information
TianlongLiang committed Oct 10, 2024
1 parent 98a4a48 commit 7135b3b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 35 deletions.
58 changes: 33 additions & 25 deletions .github/workflows/build_iwasm_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,41 @@ jobs:
key: ${{ inputs.llvm_cache_key }}
fail-on-cache-miss: true

- name: set multi-line separator on non-Windows
if: inputs.runner != 'windows-latest'
run: echo "SEP=\\" >> $GITHUB_ENV

- name: set multi-line separator on Windows
if: inputs.runner == 'windows-latest'
run: echo "SEP='" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: generate iwasm binary release
run: |
cmake -S . -B build \
-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
-DWAMR_BUILD_DEBUG_INTERP=0 \
-DWAMR_BUILD_DEBUG_AOT=0 \
-DWAMR_BUILD_DUMP_CALL_STACK=0 \
-DWAMR_BUILD_LIBC_UVWASI=0 \
-DWAMR_BUILD_LIBC_EMCC=0 \
-DWAMR_BUILD_LIB_RATS=0 \
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
-DWAMR_BUILD_MEMORY_PROFILING=0 \
-DWAMR_BUILD_MINI_LOADER=0 \
-DWAMR_BUILD_MULTI_MODULE=0 \
-DWAMR_BUILD_PERF_PROFILING=0 \
-DWAMR_BUILD_SPEC_TEST=0 \
-DWAMR_BUILD_BULK_MEMORY=1 \
-DWAMR_BUILD_LIB_PTHREAD=1 \
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
-DWAMR_BUILD_LIB_WASI_THREADS=1 \
-DWAMR_BUILD_LIBC_BUILTIN=1 \
-DWAMR_BUILD_LIBC_WASI=1 \
-DWAMR_BUILD_REF_TYPES=1 \
-DWAMR_BUILD_SIMD=1 \
-DWAMR_BUILD_SHARED_MEMORY=1 \
-DWAMR_BUILD_TAIL_CALL=1 \
cmake -S . -B build ${{ env.SEP }}
-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 ${{ env.SEP }}
-DWAMR_BUILD_CUSTOM_NAME_SECTION=0 ${{ env.SEP }}
-DWAMR_BUILD_DEBUG_INTERP=0 ${{ env.SEP }}
-DWAMR_BUILD_DEBUG_AOT=0 ${{ env.SEP }}
-DWAMR_BUILD_DUMP_CALL_STACK=0 ${{ env.SEP }}
-DWAMR_BUILD_LIBC_UVWASI=0 ${{ env.SEP }}
-DWAMR_BUILD_LIBC_EMCC=0 ${{ env.SEP }}
-DWAMR_BUILD_LIB_RATS=0 ${{ env.SEP }}
-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 ${{ env.SEP }}
-DWAMR_BUILD_MEMORY_PROFILING=0 ${{ env.SEP }}
-DWAMR_BUILD_MINI_LOADER=0 ${{ env.SEP }}
-DWAMR_BUILD_MULTI_MODULE=0 ${{ env.SEP }}
-DWAMR_BUILD_PERF_PROFILING=0 ${{ env.SEP }}
-DWAMR_BUILD_SPEC_TEST=0 ${{ env.SEP }}
-DWAMR_BUILD_BULK_MEMORY=1 ${{ env.SEP }}
-DWAMR_BUILD_LIB_PTHREAD=1 ${{ env.SEP }}
-DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 ${{ env.SEP }}
-DWAMR_BUILD_LIB_WASI_THREADS=1 ${{ env.SEP }}
-DWAMR_BUILD_LIBC_BUILTIN=1 ${{ env.SEP }}
-DWAMR_BUILD_LIBC_WASI=1 ${{ env.SEP }}
-DWAMR_BUILD_REF_TYPES=1 ${{ env.SEP }}
-DWAMR_BUILD_SIMD=1 ${{ env.SEP }}
-DWAMR_BUILD_SHARED_MEMORY=1 ${{ env.SEP }}
-DWAMR_BUILD_TAIL_CALL=1 ${{ env.SEP }}
-DWAMR_BUILD_THREAD_MGR=1
cmake --build build --config Release --parallel 4
working-directory: ${{ inputs.cwd }}
Expand Down
13 changes: 3 additions & 10 deletions wamr-compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,10 @@ endif()
# Enable LLVM
if (NOT WAMR_BUILD_WITH_CUSTOM_LLVM)
set (LLVM_SRC_ROOT "${PROJECT_SOURCE_DIR}/../core/deps/llvm")
if (WAMR_BUILD_PLATFORM STREQUAL "windows")
if (NOT EXISTS "${LLVM_SRC_ROOT}/win32build")
message (FATAL_ERROR "Cannot find LLVM dir: ${LLVM_SRC_ROOT}/win32build")
endif ()
set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/win32build;${CMAKE_PREFIX_PATH}")
else()
if (NOT EXISTS "${LLVM_SRC_ROOT}/build")
message (FATAL_ERROR "Cannot find LLVM dir: ${LLVM_SRC_ROOT}/build")
endif ()
set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/build;${CMAKE_PREFIX_PATH}")
if (NOT EXISTS "${LLVM_SRC_ROOT}/build")
message (FATAL_ERROR "Cannot find LLVM dir: ${LLVM_SRC_ROOT}/build")
endif ()
set (CMAKE_PREFIX_PATH "${LLVM_SRC_ROOT}/build;${CMAKE_PREFIX_PATH}")
endif ()

find_package(LLVM REQUIRED CONFIG)
Expand Down

0 comments on commit 7135b3b

Please sign in to comment.