From b929ee3f715a1f90b052ca675c6131e5beafa6a0 Mon Sep 17 00:00:00 2001 From: Xu Jun <693788454@qq.com> Date: Tue, 13 Oct 2020 12:13:18 +0800 Subject: [PATCH] Update windows build step, add CI support for windows (#420) --- .github/workflows/windows.yml | 59 +++++++++++++++++++++++++++++++++++ README.md | 2 +- doc/build_wamr.md | 17 +++++++++- 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..9b94ca1f9 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,59 @@ +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +name: Windows + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the main branch +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest] + steps: + - uses: actions/checkout@v2 + + - name: Build iwasm [default] + run: | + cd product-mini/platforms/windows + mkdir build && cd build + cmake .. + cmake --build . --config Release + cd .. && rm -r build + - name: Build iwasm [aot only] + run: | + cd product-mini/platforms/windows + mkdir build && cd build + cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0 + cmake --build . --config Release + cd .. && rm -r build + - name: Build iwasm [interp only] + run: | + cd product-mini/platforms/windows + mkdir build && cd build + cmake .. -DWAMR_BUILD_AOT=0 + cmake --build . --config Release + cd .. && rm -r build + - name: Build iwasm [tail call] + run: | + cd product-mini/platforms/windows + mkdir build && cd build + cmake .. -DWAMR_BUILD_TAIL_CALL=1 + cmake --build . --config Release + cd .. && rm -r build + - name: Build iwasm [custom name section] + run: | + cd product-mini/platforms/windows + mkdir build && cd build + cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1 + cmake --build . --config Release + cd .. && rm -r build + diff --git a/README.md b/README.md index 4c44f1909..aa892f874 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ The iwasm supports the following architectures: Following platforms are supported. Refer to [WAMR porting guide](./doc/port_wamr.md) for how to port WAMR to a new platform. -- [Linux](./doc/build_wamr.md#linux), [Linux SGX (Intel Software Guard Extension)](./doc/linux_sgx.md), [MacOS](./doc/build_wamr.md#macos), [Android](./doc/build_wamr.md#android), Windows +- [Linux](./doc/build_wamr.md#linux), [Linux SGX (Intel Software Guard Extension)](./doc/linux_sgx.md), [MacOS](./doc/build_wamr.md#macos), [Android](./doc/build_wamr.md#android), [Windows](./doc/build_wamr.md#windows) - [Zephyr](./doc/build_wamr.md#zephyr), [AliOS-Things](./doc/build_wamr.md#alios-things), [VxWorks](./doc/build_wamr.md#vxworks), [NuttX](./doc/build_wamr.md#nuttx) ### Build iwasm VM core (mini product) diff --git a/doc/build_wamr.md b/doc/build_wamr.md index 52090e297..8872f2dab 100644 --- a/doc/build_wamr.md +++ b/doc/build_wamr.md @@ -174,7 +174,7 @@ brew install cmake ``` Then build the source codes: -``` +``` Bash cd product-mini/platforms/darwin/ mkdir build cd build @@ -184,6 +184,21 @@ make Note: WAMR provides some features which can be easily configured by passing options to cmake, please see [WAMR vmcore cmake building configurations](./build_wamr.md#wamr-vmcore-cmake-building-configurations) for details. Currently in MacOS, interpreter, AoT, and builtin libc are enabled by default. +Windows +------------------------- + +Make sure `MSVC` and `cmake` are installed and available in the command line environment + +Then build the source codes: +``` Bash +cd product-mini/platforms/windows/ +mkdir build +cd build +cmake .. +cmake --build . --config Release +``` +The executable file is `build/Release/iwasm.exe` + VxWorks ------------------------- VxWorks 7 SR0620 release is validated.