Blame amdgpu/meson.build

Packit Service 103f6b
# Copyright © 2017-2018 Intel Corporation
Packit Service 103f6b
Packit Service 103f6b
# Permission is hereby granted, free of charge, to any person obtaining a copy
Packit Service 103f6b
# of this software and associated documentation files (the "Software"), to deal
Packit Service 103f6b
# in the Software without restriction, including without limitation the rights
Packit Service 103f6b
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Packit Service 103f6b
# copies of the Software, and to permit persons to whom the Software is
Packit Service 103f6b
# furnished to do so, subject to the following conditions:
Packit Service 103f6b
Packit Service 103f6b
# The above copyright notice and this permission notice shall be included in
Packit Service 103f6b
# all copies or substantial portions of the Software.
Packit Service 103f6b
Packit Service 103f6b
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service 103f6b
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service 103f6b
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Packit Service 103f6b
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Packit Service 103f6b
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Packit Service 103f6b
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit Service 103f6b
# SOFTWARE.
Packit Service 103f6b
Packit Service 103f6b
Packit Service 103f6b
datadir_amdgpu = join_paths(get_option('prefix'), get_option('datadir'), 'libdrm')
Packit Service 103f6b
Packit Service 103f6b
libdrm_amdgpu = shared_library(
Packit Service 103f6b
  'drm_amdgpu',
Packit Service 103f6b
  [
Packit Service 103f6b
    files(
Packit Service 103f6b
      'amdgpu_asic_id.c', 'amdgpu_bo.c', 'amdgpu_cs.c', 'amdgpu_device.c',
Packit Service 103f6b
      'amdgpu_gpu_info.c', 'amdgpu_vamgr.c', 'amdgpu_vm.c', 'handle_table.c',
Packit Service 103f6b
    ),
Packit Service 103f6b
    config_file,
Packit Service 103f6b
  ],
Packit Service 103f6b
  c_args : [
Packit Service 103f6b
    libdrm_c_args,
Packit Service 103f6b
    '-DAMDGPU_ASIC_ID_TABLE="@0@"'.format(join_paths(datadir_amdgpu, 'amdgpu.ids')),
Packit Service 103f6b
  ],
Packit Service 103f6b
  include_directories : [inc_root, inc_drm],
Packit Service 103f6b
  link_with : libdrm,
Packit Service 103f6b
  dependencies : [dep_pthread_stubs, dep_atomic_ops],
Packit Service 103f6b
  version : '1.0.0',
Packit Service 103f6b
  install : true,
Packit Service 103f6b
)
Packit Service 103f6b
Packit Service 103f6b
install_headers('amdgpu.h', subdir : 'libdrm')
Packit Service 103f6b
Packit Service 103f6b
pkg.generate(
Packit Service 103f6b
  name : 'libdrm_amdgpu',
Packit Service 103f6b
  libraries : libdrm_amdgpu,
Packit Service 103f6b
  subdirs : ['.', 'libdrm'],
Packit Service 103f6b
  version : meson.project_version(),
Packit Service 103f6b
  requires_private : 'libdrm',
Packit Service 103f6b
  description : 'Userspace interface to kernel DRM services for amdgpu',
Packit Service 103f6b
)
Packit Service 103f6b
Packit Service 103f6b
ext_libdrm_amdgpu = declare_dependency(
Packit Service 103f6b
  link_with : [libdrm, libdrm_amdgpu],
Packit Service 103f6b
  include_directories : [inc_drm, include_directories('.')],
Packit Service 103f6b
)
Packit Service 103f6b
Packit Service 103f6b
test(
Packit Service 103f6b
  'amdgpu-symbols-check',
Packit Service 103f6b
  symbols_check,
Packit Service 103f6b
  args : [
Packit Service 103f6b
    '--lib', libdrm_amdgpu,
Packit Service 103f6b
    '--symbols-file', files('amdgpu-symbols.txt'),
Packit Service 103f6b
    '--nm', prog_nm.path(),
Packit Service 103f6b
  ],
Packit Service 103f6b
)