Windows CUDA build: explicitly specify system include paths and library search paths.
NVCC doesn't respect the INCLUDE and LIB env vars from MSVC (which are set by Bazel). This change ensures NVCC uses the same include and library paths chosen by Bazel. PiperOrigin-RevId: 357959501 Change-Id: I5a7461d75b4255e59c7c7f5750da55e04d620c83
This commit is contained in:
parent
15b8b79364
commit
4bbf4dd025
@ -153,6 +153,13 @@ def InvokeNvcc(argv, log=False):
|
||||
]
|
||||
_, argv = GetOptionValue(argv, '--no-cuda-include-ptx')
|
||||
|
||||
# nvcc doesn't respect the INCLUDE and LIB env vars from MSVC,
|
||||
# so we explicity specify the system include paths and library search paths.
|
||||
if 'INCLUDE' in os.environ:
|
||||
nvccopts += [('--system-include="%s"' % p) for p in os.environ['INCLUDE'].split(";")]
|
||||
if 'LIB' in os.environ:
|
||||
nvccopts += [('--library-path="%s"' % p) for p in os.environ['LIB'].split(";")]
|
||||
|
||||
nvccopts += nvcc_compiler_options
|
||||
nvccopts += undefines
|
||||
nvccopts += defines
|
||||
|
Loading…
x
Reference in New Issue
Block a user