summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Bacci <luca.bacci982@gmail.com>2025-11-01 09:58:06 +0100
committerXavier Claessens <xclaesse@gmail.com>2025-11-01 09:05:18 -0400
commitd00f840c573103c2d51aed2b169386f7acfe7026 (patch)
treee84df44ccdddf8dba76b6b666a276de9028b6764
parent29632e692eb66ddd3bad30f47e3bf43ccb1491df (diff)
downloadmeson-d00f840c573103c2d51aed2b169386f7acfe7026.tar.gz
Compilers: Add get_depfile_format() method
-rw-r--r--mesonbuild/backend/ninjabackend.py6
-rw-r--r--mesonbuild/compilers/asm.py3
-rw-r--r--mesonbuild/compilers/compilers.py3
3 files changed, 9 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 0196e84d2..ba3f1d36e 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2614,7 +2614,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
command = compiler.get_exelist()
args = ['$ARGS'] + depargs + NinjaCommandArg.list(compiler.get_output_args('$out'), Quoting.none) + ['-cm', '$in']
description = 'Compiling to C object $in'
- if compiler.get_argument_syntax() == 'msvc':
+ if compiler.get_depfile_format() == 'msvc':
deps = 'msvc'
depfile = None
else:
@@ -2672,7 +2672,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
command = compiler.get_exelist()
args = ['$ARGS'] + depargs + NinjaCommandArg.list(compiler.get_output_args('$out'), Quoting.none) + compiler.get_compile_only_args() + ['$in']
description = f'Compiling {compiler.get_display_language()} object $out'
- if compiler.get_argument_syntax() == 'msvc':
+ if compiler.get_depfile_format() == 'msvc':
deps = 'msvc'
depfile = None
else:
@@ -2698,7 +2698,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
else:
command = compiler.get_exelist() + ['$ARGS'] + depargs + output + compiler.get_compile_only_args() + ['$in']
description = 'Precompiling header $in'
- if compiler.get_argument_syntax() == 'msvc':
+ if compiler.get_depfile_format() == 'msvc':
deps = 'msvc'
depfile = None
else:
diff --git a/mesonbuild/compilers/asm.py b/mesonbuild/compilers/asm.py
index fd6a0de33..052e83329 100644
--- a/mesonbuild/compilers/asm.py
+++ b/mesonbuild/compilers/asm.py
@@ -266,6 +266,9 @@ class MasmARMCompiler(ASMCompiler):
def get_crt_compile_args(self, crt_val: str, buildtype: str) -> T.List[str]:
return []
+ def get_depfile_format(self) -> str:
+ return 'msvc'
+
def depfile_for_object(self, objfile: str) -> T.Optional[str]:
return None
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 34520bbb6..4432f198a 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1240,6 +1240,9 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
def get_include_args(self, path: str, is_system: bool) -> T.List[str]:
return []
+ def get_depfile_format(self) -> str:
+ return 'msvc' if self.get_argument_syntax() == 'msvc' else 'gcc'
+
def depfile_for_object(self, objfile: str) -> T.Optional[str]:
return objfile + '.' + self.get_depfile_suffix()