autogen: fix race in depfile parsing

cmReadGccDepfile() calls cmSystemTools::CollapseFullPath(), which
is not thread safe due to internal caching. Serialize calls to
cmReadGccDepfile() in autogen to avoid thread safety issues.

Fixes: #22014
30 jobs for !6008 with depfile-reader-thread-safety in 12 minutes (queued for 3 seconds)
latest detached
Status Name Job ID Coverage
  Build
manual build:centos6-x86_64 #5708049
cmake build docker linux manual
passed build:debian10-iwyu #5708046
cmake build docker linux

00:02:08

manual build:fedora33-ninja #5708050
cmake build docker linux linux-3.17 manual
passed build:fedora33-sphinx #5708048
docker linux linux-3.17 cmake build

00:08:28

passed build:fedora33-tidy #5708047
cmake build docker linux linux-3.17

00:11:59

manual build:macos-x86_64-makefiles #5708052
cmake macos shell xcode-12.4 nonconcurrent manual
manual build:macos-x86_64-ninja #5708051
cmake macos shell xcode-12.4 nonconcurrent manual
manual build:windows-vs2019-x64-ninja #5708053
cmake windows shell vs2019 msvc-19.28-16.9 nonconcurrent manual
 
  Test
created test:fedora33-ninja #5708054
cmake docker linux linux-3.17 x11
created test:macos-x86_64-makefiles #5708056
cmake macos shell xcode-12.4 nonconcurrent
created test:macos-x86_64-ninja #5708055
cmake macos shell xcode-12.4 nonconcurrent
created test:windows-vs2019-x64-ninja #5708057
cmake windows shell vs2019 msvc-19.28-16.9 nonconcurrent
 
  Test Ext
created test:cuda10.2-nvidia #5708060
cmake cuda-rt docker linux
created test:debian10-ninja #5708058
cmake build docker linux linux-3.17
created test:fedora33-makefiles #5708059
cmake build docker linux linux-3.17
created test:fedora33-ninja-multi #5708061
cmake build docker linux linux-3.17
created test:macos-x86_64-xcode #5708062
cmake macos shell xcode-12.4 concurrent
created test:windows-vs2019-x64 #5708063
cmake windows shell vs2019 msvc-19.28-16.9 concurrent
 
  External
passed cdash

passed ghostflow-check-master

passed ghostflow-check-release

passed ghostflow-stager

passed cdash

passed cdash

passed cdash

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager