mirror of https://gitlab.com/ita1024/waf.git
cuda: pass correctly compiler options from nvcc to the underlying compiler with --compiler-options
This commit is contained in:
parent
e3f8191097
commit
70e7209f32
|
@ -10,7 +10,7 @@ from waflib.Tools import ccroot, c_preproc
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
|
|
||||||
class cuda(Task.Task):
|
class cuda(Task.Task):
|
||||||
run_str = '${NVCC} ${CUDAFLAGS} ${CXXFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F} ${TGT}'
|
run_str = '${NVCC} ${CUDAFLAGS} ${NVCCFLAGS_ST:CXXFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F} ${TGT}'
|
||||||
color = 'GREEN'
|
color = 'GREEN'
|
||||||
ext_in = ['.h']
|
ext_in = ['.h']
|
||||||
vars = ['CCDEPS']
|
vars = ['CCDEPS']
|
||||||
|
@ -32,6 +32,7 @@ def cxx_hook(self, node):
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
conf.find_program('nvcc', var='NVCC')
|
conf.find_program('nvcc', var='NVCC')
|
||||||
conf.find_cuda_libs()
|
conf.find_cuda_libs()
|
||||||
|
conf.env.NVCCFLAGS_ST = "--compiler-options=%s"
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def find_cuda_libs(self):
|
def find_cuda_libs(self):
|
||||||
|
|
|
@ -18,6 +18,9 @@ def configure(conf):
|
||||||
|
|
||||||
conf.load('cuda', tooldir='.')
|
conf.load('cuda', tooldir='.')
|
||||||
|
|
||||||
|
# Add a few flags to test proper passing to nvcc
|
||||||
|
conf.env.CXXFLAGS=['-fPIC', '--std=c++11']
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
|
||||||
# cuda application
|
# cuda application
|
||||||
|
|
Loading…
Reference in New Issue