diff options
author | Nicolas Schneider <nioncode+git@gmail.com> | 2019-01-27 15:10:59 +0100 |
---|---|---|
committer | Nicolas Schneider <nioncode+git@gmail.com> | 2019-02-01 22:28:53 +0100 |
commit | 3cbc7c7bd97a57419f2344edc919dbb2b2ef7d55 (patch) | |
tree | 3f54f0771598a8235903d55da2e8253e71d03f44 | |
parent | 2044bc53b3534e0e91d75b5435792e4b4d342847 (diff) | |
download | meson-3cbc7c7bd97a57419f2344edc919dbb2b2ef7d55.zip meson-3cbc7c7bd97a57419f2344edc919dbb2b2ef7d55.tar.gz meson-3cbc7c7bd97a57419f2344edc919dbb2b2ef7d55.tar.bz2 |
msvc: fix PCH staleness
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index a0b9207..e6edf8b 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2191,7 +2191,14 @@ rule FORTRAN_DEP_HACK%s elif not self.has_dir_part(d): d = os.path.join(self.get_target_private_dir(target), d) element.add_orderdep(d) - element.add_orderdep(pch_dep) + if compiler.id == 'msvc': + # MSVC does not show includes coming from the PCH with '/showIncludes', + # thus we must add an implicit dependency to the generated PCH. + element.add_dep(pch_dep) + else: + # All other compilers properly handle includes through the PCH, so only an + # orderdep is needed to make the initial build without depfile work. + element.add_orderdep(pch_dep) # Convert from GCC-style link argument naming to the naming used by the # current compiler. commands = commands.to_native() |