Ninja: Restore support for Fortran in a symlinked build tree

Since commit f3eed2c4 (cmGlobalNinjaGenerator: use P1689 dependency
file format for Fortran, 2019-03-12, v3.20.0-rc1~454^2), Fortran stopped
working in a build tree whose path contains a symlink.  The reason is
that the P1689r3 format's `work-directory` field gets populated with the
realpath (via `getcwd`) of the build tree instead of the logical path to
the build tree used for generating relative paths in `build.ninja`.
This causes the `Fortran.dd` file to get absolute (real)paths to `.o`
files, and Ninja does not match them with the relative `.o` file paths
in `build.ninja`.

Fix this by dropping use of the `work-directory` field.  This restores
our prior approach of generating paths in the dyndep file using the same
forms of paths received from the buildsystem generator.  The P1689r3
paper's format may need to be revised to account for this.

Fixes: #21683
31 jobs for !6120 with ninja-fortran-symlink in 19 minutes and 54 seconds (queued for 3 seconds)
latest detached
Status Name Job ID Coverage
  Build
passed build:centos6-x86_64 #5784456
cmake build docker linux manual

00:03:26

passed build:debian10-iwyu #5784453
cmake build docker linux

00:03:14

passed build:fedora33-ninja #5784457
cmake build docker linux linux-3.17 manual

00:02:07

passed build:fedora33-sphinx #5784455
cmake build docker linux linux-3.17

00:03:57

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

00:04:01

manual build:macos-x86_64-makefiles #5784459
nonconcurrent cmake macos shell xcode-12.4 manual
manual build:macos-x86_64-ninja #5784458
cmake macos shell xcode-12.4 nonconcurrent manual
manual build:windows-vs2019-x64-ninja #5784460
cmake windows shell vs2019 msvc-19.28-16.9 nonconcurrent manual
 
  Test
passed test:fedora33-ninja #5784461
cmake docker linux linux-3.17 x11

00:05:41

created test:macos-x86_64-makefiles #5784463
cmake macos shell xcode-12.4 nonconcurrent
created test:macos-x86_64-ninja #5784462
cmake macos shell xcode-12.4 nonconcurrent
created test:windows-vs2019-x64-ninja #5784464
cmake windows shell vs2019 msvc-19.28-16.9 nonconcurrent
 
  Test Ext
passed test:cuda10.2-nvidia #5784467
cmake cuda-rt docker linux

00:01:25

passed test:debian10-ninja #5784465
cmake build docker linux linux-3.17

00:08:53

passed test:fedora33-makefiles #5784466
cmake build docker linux linux-3.17

00:12:25

passed test:fedora33-ninja-multi #5784468
cmake build docker linux linux-3.17

00:03:27

created test:macos-x86_64-xcode #5784469
cmake macos shell xcode-12.4 concurrent
created test:windows-vs2019-x64 #5784470
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 cdash

passed cdash

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager