aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers.py
diff options
context:
space:
mode:
authorAleksey Gurtovoy <agurtovoy@acm.org>2019-09-06 12:31:26 -0500
committerDylan Baker <dylan@pnwbakers.com>2019-09-24 14:22:20 -0700
commit6ac5db50c901f172176b297d087e6123df497062 (patch)
treec57cab2ef12633b760ab0189539a932e3b465817 /mesonbuild/linkers.py
parent1670fca36fcb1a4fe4780e96731e954515501a35 (diff)
downloadmeson-6ac5db50c901f172176b297d087e6123df497062.zip
meson-6ac5db50c901f172176b297d087e6123df497062.tar.gz
meson-6ac5db50c901f172176b297d087e6123df497062.tar.bz2
CUDA support on Windows
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r--mesonbuild/linkers.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
index 795a0a2..8c5bd99 100644
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -938,6 +938,23 @@ class CudaLinker(DynamicLinker):
# we need the most verbose version output. Luckily starting with V
return out.strip().split('V')[-1]
+ def get_accepts_rsp(self) -> bool:
+ # nvcc does not support response files
+ return False
+
+ def get_lib_prefix(self) -> str:
+ if not mesonlib.is_windows():
+ return ''
+ # nvcc doesn't recognize Meson's default .a extension for static libraries on
+ # Windows and passes it to cl as an object file, resulting in 'warning D9024 :
+ # unrecognized source file type 'xxx.a', object file assumed'.
+ #
+ # nvcc's --library= option doesn't help: it takes the library name without the
+ # extension and assumes that the extension on Windows is .lib; prefixing the
+ # library with -Xlinker= seems to work.
+ from .compilers import CudaCompiler
+ return CudaCompiler.LINKER_PREFIX
+
def get_output_args(self, outname: str) -> typing.List[str]:
return ['-o', outname]
@@ -954,3 +971,6 @@ class CudaLinker(DynamicLinker):
suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str],
is_shared_module: bool) -> typing.List[str]:
return []
+
+ def get_std_shared_lib_args(self) -> typing.List[str]:
+ return ['-shared']