1# Copyright © 2018, VideoLAN and dav1d authors 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are met: 6# 7# 1. Redistributions of source code must retain the above copyright notice, this 8# list of conditions and the following disclaimer. 9# 10# 2. Redistributions in binary form must reproduce the above copyright notice, 11# this list of conditions and the following disclaimer in the documentation 12# and/or other materials provided with the distribution. 13# 14# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 25# 26# Build definition for the dav1d examples 27# 28 29# Leave subdir if examples are disabled 30if not get_option('enable_examples') 31 subdir_done() 32endif 33 34 35# dav1d player sources 36dav1dplay_sources = files( 37 'dav1dplay.c', 38 'dp_fifo.c', 39 'dp_renderer_placebo.c', 40 'dp_renderer_sdl.c', 41) 42 43sdl2_dependency = dependency('sdl2', version: '>= 2.0.1', required: true) 44 45if sdl2_dependency.found() 46 dav1dplay_deps = [sdl2_dependency, libm_dependency] 47 dav1dplay_cflags = [] 48 49 placebo_dependency = dependency('libplacebo', version: '>= 4.160.0', required: false) 50 51 if placebo_dependency.found() 52 dav1dplay_deps += placebo_dependency 53 dav1dplay_cflags += '-DHAVE_PLACEBO' 54 55 # If libplacebo is found, we might be able to use Vulkan 56 # with it, in which case we need the Vulkan library too. 57 vulkan_dependency = dependency('vulkan', required: false) 58 if vulkan_dependency.found() 59 dav1dplay_deps += vulkan_dependency 60 dav1dplay_cflags += '-DHAVE_VULKAN' 61 endif 62 endif 63 64 dav1dplay = executable('dav1dplay', 65 dav1dplay_sources, 66 rev_target, 67 68 link_with : [libdav1d, dav1d_input_objs], 69 include_directories : [dav1d_inc_dirs], 70 dependencies : [getopt_dependency, dav1dplay_deps], 71 install : true, 72 c_args : dav1dplay_cflags, 73 ) 74endif 75