diff options
author | Nomura <nomura.rh@gmail.com> | 2023-03-28 11:25:19 +0200 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-04-24 09:07:37 -0400 |
commit | 18cfa545f03ddb6cb8378fdadec4f284aa7ea221 (patch) | |
tree | d75c230d056ad9224087380d213e54a5ace40f87 /mesonbuild/backend | |
parent | bda799dff2dc4b5d607f0e822b12ed0e2db38fb7 (diff) | |
download | meson-18cfa545f03ddb6cb8378fdadec4f284aa7ea221.zip meson-18cfa545f03ddb6cb8378fdadec4f284aa7ea221.tar.gz meson-18cfa545f03ddb6cb8378fdadec4f284aa7ea221.tar.bz2 |
Initial support for Metrowerks C/C++ compiler
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index edf9c1f..45b4a11 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2446,7 +2446,12 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) output = [] else: output = NinjaCommandArg.list(compiler.get_output_args('$out'), Quoting.none) - command = compiler.get_exelist() + ['$ARGS'] + depargs + output + compiler.get_compile_only_args() + ['$in'] + + if 'mwcc' in compiler.id: + output[0].s = '-precompile' + command = compiler.get_exelist() + ['$ARGS'] + depargs + output + ['$in'] # '-c' must be removed + else: + command = compiler.get_exelist() + ['$ARGS'] + depargs + output + compiler.get_compile_only_args() + ['$in'] description = 'Precompiling header $in' if compiler.get_argument_syntax() == 'msvc': deps = 'msvc' @@ -3024,6 +3029,13 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) dep = dst + '.' + compiler.get_depfile_suffix() return commands, dep, dst, [] # Gcc does not create an object file during pch generation. + def generate_mwcc_pch_command(self, target, compiler, pch): + commands = self._generate_single_compile(target, compiler) + dst = os.path.join(self.get_target_private_dir(target), + os.path.basename(pch) + '.' + compiler.get_pch_suffix()) + dep = os.path.splitext(dst)[0] + '.' + compiler.get_depfile_suffix() + return commands, dep, dst, [] # mwcc compilers do not create an object file during pch generation. + def generate_pch(self, target, header_deps=None): header_deps = header_deps if header_deps is not None else [] pch_objects = [] @@ -3042,6 +3054,10 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) elif compiler.id == 'intel': # Intel generates on target generation continue + elif 'mwcc' in compiler.id: + src = os.path.join(self.build_to_src, target.get_source_subdir(), pch[0]) + (commands, dep, dst, objs) = self.generate_mwcc_pch_command(target, compiler, pch[0]) + extradep = None else: src = os.path.join(self.build_to_src, target.get_source_subdir(), pch[0]) (commands, dep, dst, objs) = self.generate_gcc_pch_command(target, compiler, pch[0]) |