summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yaml70
-rwxr-xr-xci/build11
-rw-r--r--unittest/CMakeLists.txt5
3 files changed, 83 insertions, 3 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index fe0e3a39..f54424b1 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -187,7 +187,7 @@ jobs:
RUN_TESTS: unittest-in-wine
apt_get: elfutils mingw-w64 wine
- - name: Windows VS2019 32-bit
+ - name: Windows VS2019 32-bit Ninja
os: windows-2019
msvc_arch: x64_x86
allow_test_failures: true # For now, don't fail the build on failure
@@ -198,8 +198,63 @@ jobs:
CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
TEST_CC: clang -target i686-pc-windows-msvc
- - name: Windows VS2019 64-bit
+ - name: Windows VS2019 32-bit MSBuild
os: windows-2019
+ msvc_arch: x64_x86
+ allow_test_failures: true # For now, don't fail the build on failure
+ CC: cl
+ CXX: cl
+ ENABLE_CACHE_CLEANUP_TESTS: 1
+ CMAKE_GENERATOR: Visual Studio 16 2019
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON -A Win32
+ TEST_CC: clang -target i686-pc-windows-msvc
+
+ - name: Windows VS2019 64-bit Ninja
+ os: windows-2019
+ msvc_arch: x64
+ allow_test_failures: true # For now, don't fail the build on failure
+ CC: cl
+ CXX: cl
+ ENABLE_CACHE_CLEANUP_TESTS: 1
+ CMAKE_GENERATOR: Ninja
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
+ TEST_CC: clang -target x86_64-pc-windows-msvc
+
+ - name: Windows VS2019 64-bit MSBuild
+ os: windows-2019
+ msvc_arch: x64
+ allow_test_failures: true # For now, don't fail the build on failure
+ CC: cl
+ CXX: cl
+ ENABLE_CACHE_CLEANUP_TESTS: 1
+ CMAKE_GENERATOR: Visual Studio 16 2019
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON -A x64
+ TEST_CC: clang -target x86_64-pc-windows-msvc
+
+ - name: Windows VS2022 32-bit Ninja
+ os: windows-2022
+ msvc_arch: x64_x86
+ allow_test_failures: true # For now, don't fail the build on failure
+ CC: cl
+ CXX: cl
+ ENABLE_CACHE_CLEANUP_TESTS: 1
+ CMAKE_GENERATOR: Ninja
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
+ TEST_CC: clang -target i686-pc-windows-msvc
+
+ - name: Windows VS2022 32-bit MSBuild
+ os: windows-2022
+ msvc_arch: x64_x86
+ allow_test_failures: true # For now, don't fail the build on failure
+ CC: cl
+ CXX: cl
+ ENABLE_CACHE_CLEANUP_TESTS: 1
+ CMAKE_GENERATOR: Visual Studio 17 2022
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON -A Win32
+ TEST_CC: clang -target i686-pc-windows-msvc
+
+ - name: Windows VS2022 64-bit Ninja
+ os: windows-2022
msvc_arch: x64
allow_test_failures: true # For now, don't fail the build on failure
CC: cl
@@ -209,6 +264,17 @@ jobs:
CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
TEST_CC: clang -target x86_64-pc-windows-msvc
+ - name: Windows VS2022 64-bit MSBuild
+ os: windows-2022
+ msvc_arch: x64
+ allow_test_failures: true # For now, don't fail the build on failure
+ CC: cl
+ CXX: cl
+ ENABLE_CACHE_CLEANUP_TESTS: 1
+ CMAKE_GENERATOR: Visual Studio 17 2022
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON -A x64
+ TEST_CC: clang -target x86_64-pc-windows-msvc
+
- name: Clang address & UB sanitizer
os: ubuntu-20.04
CC: clang
diff --git a/ci/build b/ci/build
index ff50bbfb..648bf4c2 100755
--- a/ci/build
+++ b/ci/build
@@ -17,7 +17,16 @@ else
mkdir -p ${BUILDDIR:-build}
cd ${BUILDDIR:-build}
${CMAKE_PREFIX:-} cmake ${CMAKE_PARAMS:-} ${CCACHE_LOC:-..}
- ${CMAKE_PREFIX:-} cmake --build . ${EXTRA_CMAKE_BUILD_FLAGS:-} -- -j$JOBS
+
+ case "${CMAKE_GENERATOR}" in
+ [Vv]isual" "[Ss]tudio*) # MSBuild, use all CPUs.
+ ${CMAKE_PREFIX:-} cmake --build . ${EXTRA_CMAKE_BUILD_FLAGS:-} -- -m
+ ;;
+ *) # Ninja automatically uses all available CPUs.
+ ${CMAKE_PREFIX:-} cmake --build . ${EXTRA_CMAKE_BUILD_FLAGS:-}
+ ;;
+ esac
+
case "${RUN_TESTS:-all}" in
all)
CC=${TEST_CC:-${CC}} ctest --output-on-failure -j$JOBS "$@"
diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
index 237fead4..4f52bf9c 100644
--- a/unittest/CMakeLists.txt
+++ b/unittest/CMakeLists.txt
@@ -41,6 +41,11 @@ endif()
add_executable(unittest ${source_files})
+if(MSVC)
+ # Turn off /Zc:preprocessor for this test because it triggers a bug in some older Windows 10 SDK headers.
+ set_source_files_properties(test_Stat.cpp PROPERTIES COMPILE_FLAGS /Zc:preprocessor-)
+endif()
+
target_link_libraries(
unittest
PRIVATE standard_settings standard_warnings ccache_framework third_party)