return value from function; #16
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 on multiple platforms | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-24.04, windows-latest ] | |
build_type: [ Release ] | |
c_compiler: [ gcc-14, clang-18, cl ] | |
include: | |
- os: windows-latest | |
c_compiler: cl | |
cpp_compiler: cl | |
compiler_flags: | |
linker_flags: | |
- os: ubuntu-24.04 | |
c_compiler: gcc-14 | |
cpp_compiler: g++-14 | |
compiler_flags: | |
linker_flags: | |
- os: ubuntu-24.04 | |
c_compiler: clang-18 | |
cpp_compiler: clang++-18 | |
compiler_flags: -stdlib=libc++ | |
linker_flags: -stdlib=libc++ -lc++abi | |
exclude: | |
- os: ubuntu-24.04 | |
c_compiler: cl | |
- os: windows-latest | |
c_compiler: clang-18 | |
- os: windows-latest | |
c_compiler: gcc-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Latest GCC | |
if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'gcc-14' | |
run: sudo apt install build-essential gcc-14 g++-14 | |
- name: Install Latest CLANG | |
if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang-18' | |
run: sudo apt install build-essential clang-18 libc++-18-dev libc++abi-18-dev | |
- name: Configure CMake | |
run: > | |
cmake -B "${{ github.workspace }}/build" | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_EXE_LINKER_FLAGS="${{ matrix.linker_flags }}" | |
-DCMAKE_CXX_FLAGS="${{ matrix.compiler_flags }}" | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-S ${{ github.workspace }} | |
- name: Build | |
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | |
run: cmake --build "${{ github.workspace }}/build" --config ${{ matrix.build_type }} | |
- name: Test On Linux | |
if: matrix.os == 'ubuntu-24.04' | |
working-directory: "${{ github.workspace }}/build" | |
run: ./city-test | |
- name: Test On Windows | |
if: matrix.os == 'windows-latest' | |
working-directory: "${{ github.workspace }}/build" | |
run: .\Release\city-test.exe |