fix CMakeLists.txt #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CMake build" | |
on: | |
push: | |
branches: [master] | |
paths: | |
- "src/**.c" | |
- "inc/**.h" | |
- "CMakeLists.txt" | |
- ".github/workflows/cmake-build.yml" | |
pull_request: | |
branches: [master] | |
paths: | |
- "src/**.c" | |
- "inc/**.h" | |
- "CMakeLists.txt" | |
- ".github/workflows/cmake-build.yml" | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: "Log level" | |
required: true | |
default: "warning" | |
jobs: | |
cmake-build-linux: | |
runs-on: ubuntu-latest | |
name: cmake build on ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: cmake | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DMTFMT_RT_USE_MALLOC=ON -DMTFMT_RT_USE_DIV=ON -DMTFMT_RT_USE_STDOUT=ON -DMTFMT_BUILD_SHARED=ON | |
cmake --build . | |
# 打包动态库 | |
- name: Upload artifact | |
if: github.ref == 'refs/heads/master' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cmake-linux-artifact | |
path: | | |
./build/*.so | |
cmake-build-windows: | |
runs-on: windows-latest | |
name: cmake build on windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: cmake | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DMTFMT_RT_USE_MALLOC=ON -DMTFMT_RT_USE_DIV=ON -DMTFMT_RT_USE_STDOUT=ON -DMTFMT_BUILD_SHARED=ON | |
cmake --build . --config=Release | |
shell: pwsh | |
# 打包动态库 | |
- name: Upload artifact | |
if: github.ref == 'refs/heads/master' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cmake-windows-artifact | |
path: | | |
./build/target/* |