7 #subdir('dshowdecwrapper')
8 #subdir('dshowsrcwrapper')
9 #subdir('dshowvideosink')
22 subdir('winscreencap')
25 cuda_dep = dependency('', required : false)
26 cudart_dep = dependency('', required : false)
43 # FIXME: use break syntax when we use meson >= '0.49'
44 foreach v : cuda_versions
46 cuda_dep = dependency('cuda-' + v, required: false)
47 cudart_dep = dependency('cudart-' + v, required: false)
48 if cuda_dep.found() and cudart_dep.found()
55 cuda_header_found = cc.has_header('cuda.h', dependencies: cuda_dep)
56 cuda_lib_found = cc.has_function('cuInit', dependencies: cuda_dep)
57 if not cuda_header_found or not cuda_lib_found
58 message ('Missing required header and/or function in cuda dependency')
59 cuda_dep = dependency('', required : false)
64 cudart_header_found = cc.has_header('cuda_runtime_api.h', dependencies: cudart_dep)
65 cudart_lib_found = cc.has_function('cudaGetErrorString', dependencies: cudart_dep)
66 if not cudart_header_found or not cudart_lib_found
67 message ('Missing required header and/or function in cudart dependency')
68 cudart_dep = dependency('', required : false)
72 if not cuda_dep.found() or not cudart_dep.found()
73 cuda_root = run_command(python3, '-c', 'import os; print(os.environ.get("CUDA_PATH"))').stdout().strip()
74 if cuda_root != '' and cuda_root != 'None'
75 if host_machine.system() == 'windows'
77 if build_machine.cpu_family() == 'x86_64'
82 cuda_libdir = join_paths (cuda_root, 'lib', arc)
84 cuda_libdir = [join_paths (cuda_root, 'lib'), join_paths (cuda_root, 'lib', 'stubs'),
85 join_paths (cuda_root, 'lib64'), join_paths (cuda_root, 'lib64', 'stubs')]
87 cuda_incdir = join_paths (cuda_root, 'include')
88 cuda_lib = cc.find_library('cuda', dirs: cuda_libdir, required: false)
89 cudart_lib = cc.find_library('cudart', dirs: cuda_libdir, required: false)
92 cuda_header_found = cc.has_header('cuda.h', args: '-I' + cuda_incdir)
93 cuda_lib_found = cc.has_function('cuInit', dependencies: cuda_lib)
94 if cuda_header_found and cuda_lib_found
95 cuda_dep = declare_dependency(include_directories: include_directories(cuda_incdir),
96 dependencies: cuda_lib)
100 if cudart_lib.found()
101 cudart_header_found = cc.has_header('cuda_runtime_api.h', args: '-I' + cuda_incdir)
102 cudart_lib_found = cc.has_function('cudaGetErrorString', dependencies: cudart_lib)
103 if cudart_header_found and cudart_lib_found
104 cudart_dep = declare_dependency(dependencies: cudart_lib)
111 if cuda_dep.found() and cudart_dep.found()
114 elif get_option('nvdec').enabled()
115 error('The nvdec plugin was enabled explicitly, but required CUDA dependencies were not found.')
116 elif get_option('nvenc').enabled()
117 error('The nvenc plugin was enabled explicitly, but required CUDA dependencies were not found.')