10 import SCons.Scanner.C
13 CUDAScanner = SCons.Scanner.C.CScanner()
19 tgt, src = SCons.Defaults.StaticObjectEmitter(target, source, env)
21 lifile = os.path.splitext(src[0].rstr())[0] +
'.linkinfo'
25 tgt, src = SCons.Defaults.SharedObjectEmitter(target, source, env)
27 lifile = os.path.splitext(src[0].rstr())[0] +
'.linkinfo'
32 staticObjBuilder, sharedObjBuilder = SCons.Tool.createObjBuilders(env);
33 staticObjBuilder.add_action(
'.cu',
'$STATICNVCCCMD')
34 staticObjBuilder.add_emitter(
'.cu', CUDANVCCStaticObjectEmitter)
35 sharedObjBuilder.add_action(
'.cu',
'$SHAREDNVCCCMD')
36 sharedObjBuilder.add_emitter(
'.cu', CUDANVCCSharedObjectEmitter)
37 SCons.Tool.SourceFileScanner.add_scanner(
'.cu', CUDAScanner)
44 env[
'STATICNVCCFLAGS'] =
''
45 env[
'SHAREDNVCCFLAGS'] =
''
46 env[
'ENABLESHAREDNVCCFLAG'] =
'-shared'
47 env[
'NVCCCMDLINE'] =
''
50 env[
'STATICNVCCCMD'] =
'$NVCC -o $TARGET -c $NVCCFLAGS $_CPPINCFLAGS $STATICNVCCFLAGS $NVCCCMDLINE $SOURCES'
51 env[
'SHAREDNVCCCMD'] =
'$NVCC -o $TARGET -c $NVCCFLAGS $_CPPINCFLAGS $SHAREDNVCCFLAGS $ENABLESHAREDNVCCFLAG $NVCCCMDLINE $SOURCES'
54 return env.Detect(
'nvcc')
def CUDANVCCSharedObjectEmitter
def CUDANVCCStaticObjectEmitter