Skip to content

Commit

Permalink
CI: install fmtlib on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Artsishevsky <polter.rnd@gmail.com>
  • Loading branch information
polter-rnd committed Nov 7, 2024
1 parent d06dd55 commit 37be8ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ jobs:
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install dependencies
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y libfmt-dev clang-tidy clang-format cmake-format cppcheck iwyu

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
vcpkg install fmt
vcpkg integrate install
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
Expand All @@ -70,6 +76,7 @@ jobs:
-DENABLE_FORMATTERS=ON
-DENABLE_SANITIZERS=ON
-DENABLE_FMTLIB=${{ matrix.format_lib == 'fmtlib' && 'ON' || 'OFF' }}
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-S ${{ github.workspace }}
- name: Check formatting
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTOR
include(FeatureSummary)
include(Helpers)

# Setup vcpkg
if(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE
"$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING ""
)
endif()

message(WARNING "FMT TOOLCHAIN: ${CMAKE_TOOLCHAIN_FILE}")

# Option for enabling / disabling code formatters
option(ENABLE_FORMATTERS "Code formatters" OFF)
add_feature_info("CodeFormatting" ENABLE_FORMATTERS "formatting and checking code style")
Expand Down

0 comments on commit 37be8ed

Please sign in to comment.