From aadbe1c7a04c70f189238fe67eaec06f97453e4a Mon Sep 17 00:00:00 2001 From: Dimitrij Mijoski Date: Thu, 28 Jul 2022 20:05:04 +0200 Subject: [PATCH 1/2] Improve CI on Windows --- .github/workflows/windows.yml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7d0c4a1f00d0..2f03e47f9f6b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,24 +15,30 @@ jobs: # https://github.com/actions/virtual-environments. os: [windows-2019] platform: [Win32, x64] + toolset: [v140, v141, v142] + standard: [14, 17, 20] + shared: ["", -DBUILD_SHARED_LIBS=ON] build_type: [Debug, Release] - standard: [11, 17, 20] + exclude: + - { toolset: v140, standard: 17 } + - { toolset: v140, standard: 20 } + - { toolset: v141, standard: 14 } + - { toolset: v141, standard: 20 } + - { toolset: v142, standard: 14 } + - { platform: Win32, toolset: v140 } + - { platform: Win32, toolset: v141 } + - { platform: Win32, standard: 14 } + - { platform: Win32, standard: 20 } + - { platform: x64, toolset: v140, shared: -DBUILD_SHARED_LIBS=ON } + - { platform: x64, toolset: v141, shared: -DBUILD_SHARED_LIBS=ON } + - { platform: x64, standard: 14, shared: -DBUILD_SHARED_LIBS=ON } + - { platform: x64, standard: 20, shared: -DBUILD_SHARED_LIBS=ON } include: - - os: windows-2019 - platform: Win32 - build_type: Debug - shared: -DBUILD_SHARED_LIBS=ON - os: windows-2022 platform: x64 + toolset: v143 build_type: Debug standard: 20 - exclude: - - os: windows-2019 - standard: 11 - platform: Win32 - - os: windows-2019 - standard: 20 - platform: Win32 steps: - uses: actions/checkout@v2 @@ -45,9 +51,9 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | - cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.shared}} \ - -A ${{matrix.platform}} \ + cmake -A ${{matrix.platform}} -T ${{matrix.toolset}} \ -DCMAKE_CXX_STANDARD=${{matrix.standard}} \ + ${{matrix.shared}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ $GITHUB_WORKSPACE - name: Build From 7eabee45cadd5abfaf09b7baa5e9c2a992095ae3 Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Sun, 31 Jul 2022 00:46:31 +0500 Subject: [PATCH 2/2] Workaround a bug in MSVC Signed-off-by: Vladislav Shchapov --- include/fmt/ranges.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 2e5a8e6851a4..076a78b8c559 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -419,6 +419,15 @@ template using maybe_const_range = conditional_t::value, const R, R>; +// Workaround a bug in MSVC 2015 and earlier. +#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910 +template +struct is_formattable_delayed + : disjunction< + is_formattable>, Char>, + has_fallback_formatter>, Char>> {}; +#endif + } // namespace detail template @@ -582,19 +591,14 @@ struct range_format_kind template struct formatter< R, Char, - enable_if_t::value != - range_format::disabled> -// Workaround a bug in MSVC 2017 and earlier. -#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1920 - , - disjunction< - is_formattable>, - Char>, - detail::has_fallback_formatter< - detail::uncvref_type>, Char>> + enable_if_t::value != + range_format::disabled> +// Workaround a bug in MSVC 2015 and earlier. +#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910 + , + detail::is_formattable_delayed #endif - >::value>> + >::value>> : detail::range_default_formatter::value, R, Char> { };