Skip to content

Commit

Permalink
Merge pull request #18 from aeris170/cmake-vcpkg-action
Browse files Browse the repository at this point in the history
Cmake vcpkg action
  • Loading branch information
aeris170 committed Aug 30, 2024
2 parents 915b7b2 + 1f9a5da commit 0cae86e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ jobs:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
cmake_cxx_flags: ""
cmake_exe_linker_flags: ""
- os: ubuntu-24.04
c_compiler: gcc
cpp_compiler: g++
cmake_cxx_flags: "-std=c++23"
cmake_exe_linker_flags: ""
- os: ubuntu-24.04
c_compiler: clang
cpp_compiler: clang++
cmake_cxx_flags: "-std=c++23 -stdlib=libc++ -lc++experimental"
cmake_exe_linker_flags: "-stdlib=libc++"
exclude:
- os: windows-latest
c_compiler: gcc
Expand All @@ -57,14 +63,14 @@ jobs:
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo "scripts-dir=${{ github.workspace }}/scripts" >> "$GITHUB_OUTPUT"
- name: Choose GCC versions
- name: Choose compiler versions (for Linux)
if: runner.os == 'Linux'
run: |
if [ "${{ matrix.c_compiler }}" == "gcc" ]; then
echo "CXX=gcc-14" >> $GITHUB_ENV
echo "C=gcc-14" >> $GITHUB_ENV
echo "CXX=g++-14" >> $GITHUB_ENV
elif [ "${{ matrix.c_compiler }}" == "clang" ]; then
echo "CXX=clang-18" >> $GITHUB_ENV
echo "C=clang-18" >> $GITHUB_ENV
echo "CXX=clang++-18" >> $GITHUB_ENV
else
echo "Error: Unsupported compiler '${{ matrix.c_compiler }}'. Supported compilers are GCC and Clang."
Expand Down Expand Up @@ -111,6 +117,8 @@ jobs:
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_CXX_FLAGS="${{ matrix.cmake_cxx_flags }}"
-DCMAKE_EXE_LINKER_FLAGS="${{ matrix.cmake_exe_linker_flags }}"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
Expand Down

0 comments on commit 0cae86e

Please sign in to comment.