17e102996Smaya# Copyright © 2018 Rob Clark
27e102996Smaya
37e102996Smaya# Permission is hereby granted, free of charge, to any person obtaining a copy
47e102996Smaya# of this software and associated documentation files (the "Software"), to deal
57e102996Smaya# in the Software without restriction, including without limitation the rights
67e102996Smaya# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77e102996Smaya# copies of the Software, and to permit persons to whom the Software is
87e102996Smaya# furnished to do so, subject to the following conditions:
97e102996Smaya
107e102996Smaya# The above copyright notice and this permission notice shall be included in
117e102996Smaya# all copies or substantial portions of the Software.
127e102996Smaya
137e102996Smaya# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147e102996Smaya# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
157e102996Smaya# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
167e102996Smaya# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
177e102996Smaya# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
187e102996Smaya# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
197e102996Smaya# SOFTWARE.
207e102996Smaya
217ec681f3Smrginc_freedreno = include_directories(['.', './registers', './registers/adreno', './common'])
227ec681f3Smrginc_freedreno_rnn = include_directories('rnn')
237e102996Smaya
247ec681f3Smrgrnn_src_path = meson.source_root() + '/src/freedreno/registers'
257ec681f3Smrgrnn_install_path = get_option('datadir') + '/freedreno/registers'
267ec681f3Smrgrnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path
277ec681f3Smrg
287ec681f3Smrgdep_lua = dependency('lua53', required: false)
297ec681f3Smrgif not dep_lua.found()
307ec681f3Smrg  dep_lua = dependency('lua52', required: false)
317ec681f3Smrgendif
327ec681f3Smrgif not dep_lua.found()
337ec681f3Smrg  dep_lua = dependency('lua', required: false, version : '>=5.2')
347ec681f3Smrgendif
357ec681f3Smrg
367ec681f3Smrgdep_libarchive = dependency('libarchive', required: false)
377ec681f3Smrgdep_libxml2 = dependency('libxml-2.0', required: false)
387ec681f3Smrgprog_gzip = find_program('gzip', required: false)
397ec681f3Smrg
407ec681f3Smrginstall_fd_decode_tools = dep_libxml2.found() and prog_gzip.found() and \
417ec681f3Smrg  with_tools.contains('freedreno')
427ec681f3Smrg
437ec681f3Smrgsubdir('common')
447ec681f3Smrgsubdir('registers')
457ec681f3Smrgsubdir('isa')
467e102996Smayasubdir('drm')
477ec681f3Smrgsubdir('ir2')
487e102996Smayasubdir('ir3')
497ec681f3Smrgsubdir('fdl')
507ec681f3Smrgsubdir('perfcntrs')
517ec681f3Smrgsubdir('computerator')
527ec681f3Smrg
537ec681f3Smrgif with_perfetto and (with_datasources.contains('freedreno') or with_datasources.contains('auto'))
547ec681f3Smrg  subdir('ds')
557ec681f3Smrgendif
567ec681f3Smrg
577ec681f3Smrg# Everything that depends on rnn requires (indirectly) libxml2:
587ec681f3Smrgif dep_libxml2.found()
597ec681f3Smrg  subdir('rnn')
607ec681f3Smrg  subdir('decode')
617ec681f3Smrg  subdir('afuc')
627ec681f3Smrgendif
637ec681f3Smrg
647ec681f3Smrgif with_tools.contains('drm-shim')
657ec681f3Smrg  subdir('drm-shim')
667ec681f3Smrgendif
677e102996Smaya
687e102996Smayaif with_freedreno_vk
697e102996Smaya  subdir('vulkan')
707e102996Smayaendif
71