Skip to content

Commit

Permalink
ENH: Update build-matrix.yml to include Ubuntu in the matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunner246 committed Jun 2, 2024
1 parent 4faac25 commit 53df7d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 43 deletions.
40 changes: 5 additions & 35 deletions .github/workflows/build-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,23 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest] # , ubuntu-latest
os: [windows-latest, ubuntu-latest, macos-latest] #
include:
- os: windows-latest
compiler: msvc
# - os: ubuntu-latest
# compiler: gcc
- os: ubuntu-latest
compiler: gcc
- os: macos-latest
compiler: clang
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Install Ninja
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
choco install ninja --yes --force
elif [[ "${{ runner.os }}" == "Linux" ]]; then
sudo apt-get install -y ninja-build
elif [[ "${{ runner.os }}" == "macOS" ]]; then
brew upgrade ninja || brew install ninja
fi
- name: Install LLVM (macOS only)
if: matrix.os == 'macos-latest'
run: |
brew install llvm
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
- name: Cache vcpkg
uses: actions/[email protected]
with:
path: |
vcpkg
vcpkg_installed
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}

- name: vcpkg installation
shell: bash
run: |
Expand All @@ -63,12 +37,8 @@ jobs:
- name: Configure CMake
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++
else
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
fi
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
# cmake -B build -DCMAKE_BUILD_TYPE=Release -DCPM_SOURCE_CACHE=~/cpm-cache
- name: Build
run: |
cmake --build build --config Release
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ if (CMAKE_CXX_STANDARD LESS 23)
endif ()

if (MSVC)
add_compile_options(/W4 /WX /experimental:module /std:c++latest)
add_compile_options(/W4 /WX /std:c++latest)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wall -Wextra -pedantic -Werror -std=c++23)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(-Wall -Wextra -pedantic -Werror -fmodules -fbuiltin-module-map -c -std=c++2b)
add_compile_options(-Wall -Wextra -pedantic -Werror -std=c++2b)
else ()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with MSVC, GCC and Clang.")
endif ()
Expand All @@ -25,7 +25,6 @@ configure_file(
)

set(BUILD_SHARED_LIBS ON)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)

set(CPM_DOWNLOAD_LOCATION "${CMAKE_SOURCE_DIR}/cmake/CPM.cmake")

Expand Down
10 changes: 5 additions & 5 deletions gtfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ add_library(${PROJECT_NAME} SHARED
src/strategies/GtfsCalendarReader.h
)

target_sources(${PROJECT_NAME}
PUBLIC
FILE_SET all_my_modules TYPE CXX_MODULES FILES
src/mod.test.cppm
)
# target_sources(${PROJECT_NAME}
# PUBLIC
# FILE_SET all_my_modules TYPE CXX_MODULES FILES
# src/mod.test.cppm
# )

message("CU_LIST_DIR UO: ${CMAKE_CURRENT_LIST_DIR}")

Expand Down

0 comments on commit 53df7d9

Please sign in to comment.