10 #subdir('dshowdecwrapper')
11 #subdir('dshowsrcwrapper')
12 #subdir('dshowvideosink')
25 subdir('winscreencap')
28 cuda_dep = dependency('', required : false)
29 cudart_dep = dependency('', required : false)
33 if host_machine.system() == 'windows'
34 # On windows, CUDA_PATH env will be set by installer
35 cuda_root = run_command(python3, '-c', 'import os; print(os.environ.get("CUDA_PATH"))').stdout().strip()
36 if cuda_root != '' and cuda_root != 'None'
38 if build_machine.cpu_family() == 'x86_64'
43 cuda_libdir = join_paths (cuda_root, 'lib', arc)
44 cuda_incdir = join_paths (cuda_root, 'include')
45 cuda_lib = cc.find_library('cuda', dirs: cuda_libdir, required: false)
46 cudart_lib = cc.find_library('cudart', dirs: cuda_libdir, required: false)
48 cuda_header_found = cc.has_header('cuda.h', args: '-I' + cuda_incdir)
49 cuda_lib_found = cc.has_function('cuInit', dependencies: cuda_lib)
50 if cuda_header_found and cuda_lib_found
51 cuda_dep = declare_dependency(include_directories: include_directories(cuda_incdir),
52 dependencies: cuda_lib)
57 cudart_header_found = cc.has_header('cuda_runtime_api.h', args: '-I' + cuda_incdir)
58 cudart_lib_found = cc.has_function('cudaGetErrorString', dependencies: cudart_lib)
59 if cudart_header_found and cudart_lib_found
60 cudart_dep = declare_dependency(dependencies: cudart_lib)
77 # FIXME: use break syntax when we use meson >= '0.49'
78 foreach v : cuda_versions
80 cuda_dep = dependency('cuda-' + v, required: false)
81 cudart_dep = dependency('cudart-' + v, required: false)
82 if cuda_dep.found() and cudart_dep.found()
89 cuda_header_found = cc.has_header('cuda.h', dependencies: cuda_dep)
90 cuda_lib_found = cc.has_function('cuInit', dependencies: cuda_dep)
91 if not cuda_header_found or not cuda_lib_found
92 message ('Missing required header and/or function in cuda dependency')
93 cuda_dep = dependency('', required : false)
98 cudart_header_found = cc.has_header('cuda_runtime_api.h', dependencies: cudart_dep)
99 cudart_lib_found = cc.has_function('cudaGetErrorString', dependencies: cudart_dep)
100 if not cudart_header_found or not cudart_lib_found
101 message ('Missing required header and/or function in cudart dependency')
102 cudart_dep = dependency('', required : false)
107 if cuda_dep.found() and cudart_dep.found()
110 elif get_option('nvdec').enabled()
111 error('The nvdec plugin was enabled explicitly, but required CUDA dependencies were not found.')
112 elif get_option('nvenc').enabled()
113 error('The nvenc plugin was enabled explicitly, but required CUDA dependencies were not found.')