Skip to content

Build on Windows

Build on Windows #7

Workflow file for this run

name: Build on Windows
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
windows_build:
runs-on: windows-2019
strategy:
matrix:
platform:
- x86
- x64
config:
- Release
- Debug
include:
- fmt-header-only: 'ON'
- platform: x64
config: Release
fmt-header-only: 'OFF'
- platform: x86
cmake_generator: 'G \"Visual Studio 16 2019\" -A Win32"'
- platform: x64
cmake_generator: '-G \"Visual Studio 16 2019\" -A x64"'
steps:
- name: explicitly disable autocrlf
run: git config --global core.autocrlf false
- uses: actions/[email protected]
# - name: set cmake generator for x86 platform
# if: ${{ matrix.platform == 'x86' }}
# run:
# echo "cmake_generator=-'G \"Visual Studio 16 2019\" -A Win32'" >> "$GITHUB_ENV"
# - name: set cmake generator for x64 platform
# if: ${{ matrix.platform == 'x64' }}
# run:
# echo "cmake_generator='-G \"Visual Studio 16 2019\" -A x64'" >> "$GITHUB_ENV"
- name: install fmtlib
run: |
git clone https://github.com/fmtlib/fmt.git
mkdir fmt/build
cd fmt/build
cmake -DFMT_TEST=OFF \
-DFMT_DOC=OFF \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.cmake_generator }} \
..
cmake --build . --config Release --target install
shell: bash
- name: build lfp
run: |
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS="/D_CRT_SECURE_NO_WARNINGS" \
-DLFP_FMT_HEADER_ONLY=${{ matrix.fmt-header-only }} \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
${{ matrix.cmake_generator }} \
..
cmake --build . --config ${{ matrix.config }} --target install
ctest -C ${{ matrix.config }} --verbose
shell: bash