Files
CMake/Tests/RunCMake/VS10Project/CustomCommandParallel.cmake
Brad King d6353e74b4 VS: Add policy to build custom commands concurrently
In commit 33c15ae2b9 (VS: Build custom commands concurrently when
possible, 2023-01-19, v3.26.0-rc1~56^2) we added `BuildInParallel` to
custom commands in `.vcxproj` files, but that had to be reverted by
commit abb1c12162 (VS: Revert "Build custom commands concurrently when
possible", 2023-03-07, v3.26.0-rc6~3^2) because some projects may have
custom commands that accidentally rely on serial execution in MSBuild.

Add a policy to use `BuildInParallel` for custom commands in projects
that have been updated to set the policy to `NEW`.

Fixes: #18405
2023-03-12 07:51:58 -04:00

6 lines
261 B
CMake

cmake_policy(VERSION 3.26) # CMP0147 left unset
add_custom_command(OUTPUT "cmp0147-old.txt" COMMAND echo)
cmake_policy(SET CMP0147 NEW)
add_custom_command(OUTPUT "cmp0147-new.txt" COMMAND echo)
add_custom_target(foo DEPENDS "cmp0147-old.txt" "cmp0147-new.txt")