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