From f830c99a73669fb1dc7c7fe51466ef971eb2e919 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Tue, 7 Feb 2023 11:22:51 -0800 Subject: [PATCH] Enable parallel compilation for MSVC builds. The `BuildInParallel` flag only controls parallelism at the *project* level, while `/MP` enables it at the *compilation unit* level. PiperOrigin-RevId: 507837073 --- .github/workflows/test_cpp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index bafcc5bcfa..fe0628c776 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -253,7 +253,7 @@ jobs: - name: Build for Windows 15 2017 run: >- - msbuild.exe protobuf.sln /maxcpucount:8 /p:BuildInParallel=true + msbuild.exe protobuf.sln /p:MultiProcessorCompilation=true /p:CL_MPCount=8 /maxcpucount:8 /p:BuildInParallel=true /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 ${{ env.CCACHE_MSBUILD_FLAGS }} @@ -300,7 +300,7 @@ jobs: - name: Build and Install Protobuf for Windows 15 2017 run: | pushd build - msbuild.exe INSTALL.vcxproj /p:Platform=x64 /p:VisualStudioVersion=15.0 /maxcpucount:8 /p:BuildInParallel=true ${{ env.CCACHE_MSBUILD_FLAGS }} + msbuild.exe INSTALL.vcxproj /p:Platform=x64 /p:VisualStudioVersion=15.0 /p:MultiProcessorCompilation=true /p:CL_MPCount=8 /maxcpucount:8 /p:BuildInParallel=true ${{ env.CCACHE_MSBUILD_FLAGS }} popd - name: Clear CMake cache @@ -319,7 +319,7 @@ jobs: - name: Build for Windows 15 2017 run: >- - msbuild.exe protobuf.sln /maxcpucount:8 /p:BuildInParallel=true + msbuild.exe protobuf.sln /p:MultiProcessorCompilation=true /p:CL_MPCount=8 /maxcpucount:8 /p:BuildInParallel=true /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 ${{ env.CCACHE_MSBUILD_FLAGS }}