增加23.7节代码 #114
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: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-unix-makefiles: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Print CMake Version | |
run: cmake --version | |
- name: Configure CMake | |
run: cmake -G "Unix Makefiles" -B cmake-build -D CMAKE_BUILD_TYPE=Release | |
- name: Build | |
run: cmake --build cmake-build -j 4 | |
- name: Test | |
working-directory: ${{ github.workspace }}/cmake-build | |
run: ctest | |
build-mingw-makefiles: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Print CMake Version | |
run: cmake --version | |
- name: Configure CMake | |
run: > | |
cmake -G "MinGW Makefiles" -B cmake-build -D CMAKE_BUILD_TYPE=Release | |
-D CMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" | |
-D OPTION_USE_SYSTEM_LIBJPEG=OFF -D OPTION_USE_SYSTEM_LIBPNG=OFF -D OPTION_USE_SYSTEM_ZLIB=OFF | |
- name: Build | |
run: cmake --build cmake-build -j 4 | |
- name: Test | |
working-directory: ${{ github.workspace }}/cmake-build | |
run: ctest | |
build-visual-studio: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Print CMake Version | |
run: cmake --version | |
- name: Configure CMake | |
run: cmake -G "Visual Studio 17 2022" -A x64 -B cmake-build | |
- name: Build | |
run: cmake --build cmake-build -j 4 --config Release | |
- name: Test | |
working-directory: ${{ github.workspace }}/cmake-build | |
run: ctest -C Release |