[CMake] enable CMP0147 policy if available (#109150)

Closes #38383.

This enables parallel custom build commands, which improve compilation
time on Windows with Visual Studio.
This commit is contained in:
c8ef 2024-09-25 04:30:31 +08:00 committed by GitHub
parent 491123562a
commit cf9fc5e22f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,3 +29,9 @@ endif()
if(POLICY CMP0144) if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW) cmake_policy(SET CMP0144 NEW)
endif() endif()
# CMP0147: Visual Studio Generators build custom commands in parallel.
# New in CMake 3.27: https://cmake.org/cmake/help/latest/policy/CMP0147.html
if(POLICY CMP0147)
cmake_policy(SET CMP0147 NEW)
endif()