aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/d.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-03-09 14:04:02 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-03-14 22:05:55 -0700
commit320412b3bbe97d8779d715f992f7a88d3a461ace (patch)
treea5c15017ca17eacef97278441e46f59ac36136cc /mesonbuild/compilers/d.py
parentbe86199221046fa5527b93b8c7231c6c3af344d4 (diff)
downloadmeson-320412b3bbe97d8779d715f992f7a88d3a461ace.zip
meson-320412b3bbe97d8779d715f992f7a88d3a461ace.tar.gz
meson-320412b3bbe97d8779d715f992f7a88d3a461ace.tar.bz2
compilers/linkers: Add a methhod for getting the rspfile syntax
Diffstat (limited to 'mesonbuild/compilers/d.py')
-rw-r--r--mesonbuild/compilers/d.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 92d54e9..d032809 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -18,7 +18,7 @@ import subprocess
import typing as T
from ..mesonlib import (
- EnvironmentException, MachineChoice, version_compare, OptionKey,
+ EnvironmentException, MachineChoice, version_compare, OptionKey, is_windows
)
from ..arglist import CompilerArgs
@@ -36,7 +36,7 @@ if T.TYPE_CHECKING:
from ..dependencies import Dependency, ExternalProgram
from ..envconfig import MachineInfo
from ..environment import Environment
- from ..linkers import DynamicLinker
+ from ..linkers import DynamicLinker, RSPFileSyntax
else:
CompilerMixinBase = object
@@ -780,6 +780,12 @@ class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler):
def get_disable_assert_args(self) -> T.List[str]:
return ['--release']
+ def rsp_file_syntax(self) -> 'RSPFileSyntax':
+ # We use `mesonlib.is_windows` here because we want to konw what the
+ # build machine is, not the host machine. This really means whe whould
+ # have the Environment not the MachineInfo in the compiler.
+ return RSPFileSyntax.MSVC if is_windows() else RSPFileSyntax.GCC
+
class DmdDCompiler(DmdLikeCompilerMixin, DCompiler):
@@ -860,3 +866,6 @@ class DmdDCompiler(DmdLikeCompilerMixin, DCompiler):
def get_disable_assert_args(self) -> T.List[str]:
return ['-release']
+
+ def rsp_file_syntax(self) -> 'RSPFileSyntax':
+ return RSPFileSyntax.MSVC