summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNomura <nomura.rh@gmail.com>2023-05-15 13:50:59 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-05-15 23:43:04 -0400
commit40e27b14f1db25f36b48e21821a17143dbb3a066 (patch)
tree7b4fd7dbfeb44af4f2f0788f9cf6cf8e38971f1e
parenta8b144b71b0780c211a5ecfbafab1a5b3e07bcf0 (diff)
downloadmeson-40e27b14f1db25f36b48e21821a17143dbb3a066.tar.gz
Metrowerks: move PCH args to the end of the command line
-rw-r--r--mesonbuild/backend/ninjabackend.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index a3c0fa33b..8a3f72c71 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2854,10 +2854,16 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
# Include PCH header as first thing as it must be the first one or it will be
# ignored by gcc https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100462
- if self.environment.coredata.options.get(OptionKey('b_pch')) and is_generated != 'pch':
+ use_pch = self.environment.coredata.options.get(OptionKey('b_pch')) and is_generated != 'pch'
+ if use_pch and 'mw' not in compiler.id:
commands += self.get_pch_include_args(compiler, target)
commands += self._generate_single_compile_target_args(target, compiler, is_generated)
+
+ # Metrowerks compilers require PCH include args to come after intraprocedural analysis args
+ if use_pch and 'mw' in compiler.id:
+ commands += self.get_pch_include_args(compiler, target)
+
commands = commands.compiler.compiler_args(commands)
# Create introspection information