1bf215546Sopenharmony_ci# Copyright © 2017 Dylan Baker
2bf215546Sopenharmony_ci# Copyright © 2018 Intel Corporation
3bf215546Sopenharmony_ci
4bf215546Sopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy
5bf215546Sopenharmony_ci# of this software and associated documentation files (the "Software"), to deal
6bf215546Sopenharmony_ci# in the Software without restriction, including without limitation the rights
7bf215546Sopenharmony_ci# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8bf215546Sopenharmony_ci# copies of the Software, and to permit persons to whom the Software is
9bf215546Sopenharmony_ci# furnished to do so, subject to the following conditions:
10bf215546Sopenharmony_ci
11bf215546Sopenharmony_ci# The above copyright notice and this permission notice shall be included in
12bf215546Sopenharmony_ci# all copies or substantial portions of the Software.
13bf215546Sopenharmony_ci
14bf215546Sopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15bf215546Sopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16bf215546Sopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17bf215546Sopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18bf215546Sopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19bf215546Sopenharmony_ci# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20bf215546Sopenharmony_ci# SOFTWARE.
21bf215546Sopenharmony_ci
22bf215546Sopenharmony_ci# TODO: support non-static targets
23bf215546Sopenharmony_ci# Static targets are always enabled in autotools (unless you modify
24bf215546Sopenharmony_ci# configure.ac)
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_cinine_version = ['1', '0', '0']
27bf215546Sopenharmony_ci
28bf215546Sopenharmony_cigallium_nine_c_args = []
29bf215546Sopenharmony_cigallium_nine_ld_args = []
30bf215546Sopenharmony_cigallium_nine_link_depends = []
31bf215546Sopenharmony_cigallium_nine_link_with = [
32bf215546Sopenharmony_ci    libgallium, libnine_st,
33bf215546Sopenharmony_ci    libpipe_loader_static, libws_null, libwsw, libswdri,
34bf215546Sopenharmony_ci    libswkmsdri,
35bf215546Sopenharmony_ci]
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ciif with_ld_version_script
38bf215546Sopenharmony_ci  gallium_nine_ld_args += ['-Wl,--version-script', join_paths(meson.current_source_dir(), 'd3dadapter9.sym')]
39bf215546Sopenharmony_ci  gallium_nine_link_depends += files('d3dadapter9.sym')
40bf215546Sopenharmony_ciendif
41bf215546Sopenharmony_ci
42bf215546Sopenharmony_ciif (with_gallium_va or with_gallium_vdpau or with_gallium_omx != 'disabled' or
43bf215546Sopenharmony_ci    with_gallium_xvmc or with_dri)
44bf215546Sopenharmony_ci  gallium_nine_link_with += libgalliumvl
45bf215546Sopenharmony_cielse
46bf215546Sopenharmony_ci  gallium_nine_link_with += libgalliumvl_stub
47bf215546Sopenharmony_ciendif
48bf215546Sopenharmony_ci
49bf215546Sopenharmony_cilibgallium_nine = shared_library(
50bf215546Sopenharmony_ci  'd3dadapter9',
51bf215546Sopenharmony_ci  files('description.c', 'getproc.c', 'drm.c'),
52bf215546Sopenharmony_ci  include_directories : [
53bf215546Sopenharmony_ci    inc_include, inc_src, inc_loader, inc_mapi, inc_mesa, inc_util,
54bf215546Sopenharmony_ci    inc_gallium, inc_gallium_aux, inc_gallium_winsys,
55bf215546Sopenharmony_ci    inc_gallium_drivers, inc_d3d9,
56bf215546Sopenharmony_ci    include_directories('../../frontends/nine'),
57bf215546Sopenharmony_ci  ],
58bf215546Sopenharmony_ci  c_args : [gallium_nine_c_args],
59bf215546Sopenharmony_ci  gnu_symbol_visibility : 'hidden',
60bf215546Sopenharmony_ci  link_args : [ld_args_build_id, ld_args_gc_sections, gallium_nine_ld_args],
61bf215546Sopenharmony_ci  link_depends : gallium_nine_link_depends,
62bf215546Sopenharmony_ci  link_with : gallium_nine_link_with,
63bf215546Sopenharmony_ci  dependencies : [
64bf215546Sopenharmony_ci    dep_selinux, dep_libdrm, dep_llvm, dep_thread,
65bf215546Sopenharmony_ci    idep_xmlconfig, idep_mesautil, idep_nir,
66bf215546Sopenharmony_ci    driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
67bf215546Sopenharmony_ci    driver_i915, driver_svga, driver_iris, driver_crocus, driver_zink
68bf215546Sopenharmony_ci  ],
69bf215546Sopenharmony_ci  name_prefix : '',
70bf215546Sopenharmony_ci  version : '.'.join(nine_version),
71bf215546Sopenharmony_ci  install : true,
72bf215546Sopenharmony_ci  install_dir : d3d_drivers_path,
73bf215546Sopenharmony_ci)
74bf215546Sopenharmony_ci
75bf215546Sopenharmony_cipkg.generate(
76bf215546Sopenharmony_ci  name : 'd3d',
77bf215546Sopenharmony_ci  description : 'Native D3D driver modules',
78bf215546Sopenharmony_ci  version : '.'.join(nine_version),
79bf215546Sopenharmony_ci  requires_private : 'libdrm >= ' + dep_libdrm.version(),
80bf215546Sopenharmony_ci  variables : ['moduledir=@0@'.format(d3d_drivers_path)],
81bf215546Sopenharmony_ci)
82