Sfoglia il codice sorgente

Update windows build step, add CI support for windows (#420)

Xu Jun 5 anni fa
parent
commit
b929ee3f71
3 ha cambiato i file con 76 aggiunte e 2 eliminazioni
  1. 59 0
      .github/workflows/windows.yml
  2. 1 1
      README.md
  3. 16 1
      doc/build_wamr.md

+ 59 - 0
.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
+

+ 1 - 1
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)

+ 16 - 1
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.