diff options
author | Remi Thebault <remi.thebault@gmail.com> | 2021-03-09 17:12:31 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-03-09 21:17:41 +0200 |
commit | 89202aaaef3fde7a8d4e378629526146ad1f7f30 (patch) | |
tree | 94c6a2d649a452b70b6f11fada6e4618f215d286 | |
parent | c83106ee38048acbe737ef112e8d51c9b5bd42d7 (diff) | |
download | meson-89202aaaef3fde7a8d4e378629526146ad1f7f30.zip meson-89202aaaef3fde7a8d4e378629526146ad1f7f30.tar.gz meson-89202aaaef3fde7a8d4e378629526146ad1f7f30.tar.bz2 |
change RSP quote style decision logic
Take into account LDC on Windows
Fixes #8494
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 3f58f0d..c3a5ffe 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -33,7 +33,9 @@ from ..arglist import CompilerArgs from ..compilers import ( Compiler, CCompiler, DmdDCompiler, - FortranCompiler, PGICCompiler, + FortranCompiler, + LLVMDCompiler, + PGICCompiler, VisualStudioCsCompiler, VisualStudioLikeCompiler, ) @@ -89,6 +91,13 @@ else: execute_wrapper = [] rmfile_prefix = ['rm', '-f', '{}', '&&'] + +def dlang_cl_rsp(compiler: Compiler) -> bool: + '''Return whether the D compiler accepts cl style RSP quote''' + return (isinstance(compiler, DmdDCompiler) or + mesonlib.is_windows() and isinstance(compiler, LLVMDCompiler)) + + def get_rsp_threshold(): '''Return a conservative estimate of the commandline size in bytes above which a response file should be used. May be overridden for @@ -1887,7 +1896,7 @@ int dummy; self.add_rule(NinjaRule(rule, command, args, description, rspable=compiler.can_linker_accept_rsp(), rspfile_quote_style='cl' if (compiler.get_argument_syntax() == 'msvc' or - isinstance(compiler, DmdDCompiler)) else 'gcc', + dlang_cl_rsp(compiler)) else 'gcc', extra=pool)) args = self.environment.get_build_command() + \ @@ -2011,7 +2020,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) self.add_rule(NinjaRule(rule, command, args, description, rspable=compiler.can_linker_accept_rsp(), rspfile_quote_style='cl' if (compiler.get_argument_syntax() == 'msvc' or - isinstance(compiler, DmdDCompiler)) else 'gcc', + dlang_cl_rsp(compiler)) else 'gcc', deps=deps, depfile=depfile)) def generate_pch_rule_for(self, langname, compiler): |