diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8dabd34c82..21c2d219dd 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -86,7 +86,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" cmake -B bld -G Ninja ${options} \ - -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=32 -DCURL_TEST_BUNDLES=ON \ -DCURL_WERROR=ON \ ${{ matrix.config }} else @@ -252,7 +252,7 @@ jobs: cmake -B bld -G Ninja ${options} \ -DCMAKE_C_FLAGS="${{ matrix.cflags }} ${CFLAGS_CMAKE} ${CPPFLAGS}" \ -DCMAKE_BUILD_TYPE='${{ matrix.type }}' \ - -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=32 -DCURL_TEST_BUNDLES=ON \ -DCURL_WERROR=ON \ ${{ matrix.config }} else @@ -438,7 +438,7 @@ jobs: cmake -B bld -G 'MSYS Makefiles' ${options} \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_BUILD_TYPE='${{ matrix.type }}' \ - -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ + -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 -DCURL_TEST_BUNDLES=ON \ -DCURL_WERROR=ON \ -DCURL_USE_LIBPSL=OFF \ ${{ matrix.config }} diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 168fa20cf3..5f1b395f0a 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -55,6 +55,9 @@ if(CURL_BUILD_TESTING) ) target_compile_definitions(curlu PUBLIC "UNITTESTS" "CURL_STATICLIB") target_link_libraries(curlu PRIVATE ${CURL_LIBS}) + # There is plenty of parallelism when building the testdeps target. + # Override the curlu batch size with the maximum to optimize performance. + set_target_properties(curlu PROPERTIES UNITY_BUILD_BATCH_SIZE 0) endif() if(ENABLE_CURLDEBUG)