17ec681f3Smrg# Copyright © 2020-2021 Collabora, Ltd.
27ec681f3Smrg# Author: Antonio Caggiano <antonio.caggiano@collabora.com>
37ec681f3Smrg#
47ec681f3Smrg# SPDX-License-Identifier: MIT
57ec681f3Smrg
67ec681f3Smrgpps_sources = [
77ec681f3Smrg  'pps.cc',
87ec681f3Smrg  'pps_device.cc',
97ec681f3Smrg  'pps_driver.cc',
107ec681f3Smrg  'pps_counter.cc',
117ec681f3Smrg]
127ec681f3Smrg
137ec681f3Smrginclude_pps = include_directories('../')
147ec681f3Smrg
157ec681f3Smrgdep_drm = dependency('libdrm')
167ec681f3Smrgpps_deps = [dep_drm, dep_perfetto]
177ec681f3Smrgpps_deps += pps_datasources
187ec681f3Smrg
197ec681f3Smrglib_pps = static_library(
207ec681f3Smrg  'pps',
217ec681f3Smrg  sources: pps_sources,
227ec681f3Smrg  include_directories: [include_pps, inc_src, pps_includes],
237ec681f3Smrg  dependencies: pps_deps,
247ec681f3Smrg  cpp_args: '-std=c++17'
257ec681f3Smrg)
267ec681f3Smrg
277ec681f3Smrgdep_pps = declare_dependency(
287ec681f3Smrg  link_with: lib_pps,
297ec681f3Smrg  include_directories: [include_pps, inc_src]
307ec681f3Smrg)
317ec681f3Smrg
327ec681f3Smrgproducer_sources = [
337ec681f3Smrg  'pps_datasource.cc',
347ec681f3Smrg  'pps_producer.cc'
357ec681f3Smrg]
367ec681f3Smrg
377ec681f3Smrgexecutable(
387ec681f3Smrg  'pps-producer',
397ec681f3Smrg  sources: producer_sources,
407ec681f3Smrg  include_directories: [include_pps, inc_src],
417ec681f3Smrg  dependencies: [dep_pps, dep_perfetto],
427ec681f3Smrg  cpp_args: '-std=c++17',
437ec681f3Smrg  install: true
447ec681f3Smrg)
457ec681f3Smrg
467ec681f3Smrgconfig_sources = [
477ec681f3Smrg  'pps_config.cc'
487ec681f3Smrg]
497ec681f3Smrg
507ec681f3Smrgdep_docopt = dependency('docopt', required: false)
517ec681f3Smrg
527ec681f3Smrgif dep_docopt.found()
537ec681f3Smrg  executable(
547ec681f3Smrg    'pps-config',
557ec681f3Smrg    sources: config_sources,
567ec681f3Smrg    include_directories: [include_pps, inc_src],
577ec681f3Smrg    dependencies: [dep_pps, dep_docopt],
587ec681f3Smrg    cpp_args: '-std=c++17',
597ec681f3Smrg    install: true
607ec681f3Smrg  )
617ec681f3Smrgendif
62