intel: tools: simplify meson build
[mesa.git] / src / intel / tools / meson.build
1 # Copyright © 2017 Intel Corporation
2
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE.
20
21 build_intel_tools = with_tools.contains('intel')
22
23 aubinator = executable(
24 'aubinator',
25 files('aubinator.c', 'intel_aub.h'),
26 dependencies : [dep_expat, dep_zlib, dep_dl, dep_thread, dep_m],
27 include_directories : [inc_common, inc_intel],
28 link_with : [libintel_common, libintel_compiler, libintel_dev, libmesa_util],
29 c_args : [c_vis_args, no_override_init_args],
30 build_by_default : build_intel_tools,
31 install : build_intel_tools
32 )
33
34 aubinator_error_decode = executable(
35 'aubinator_error_decode',
36 files('aubinator_error_decode.c'),
37 dependencies : [dep_zlib, dep_thread],
38 include_directories : [inc_common, inc_intel],
39 link_with : [libintel_common, libintel_compiler, libintel_dev, libmesa_util],
40 c_args : [c_vis_args, no_override_init_args],
41 build_by_default : build_intel_tools,
42 install : build_intel_tools
43 )
44
45 error2aub = executable(
46 'intel_error2aub',
47 files('aub_write.h', 'aub_write.c', 'error2aub.c'),
48 dependencies : [dep_zlib, dep_dl, dep_thread, dep_m],
49 include_directories : [inc_common, inc_intel, inc_drm_uapi],
50 link_with : [libintel_dev],
51 c_args : [c_vis_args, no_override_init_args],
52 build_by_default : build_intel_tools,
53 install : build_intel_tools
54 )
55
56 sanitize_data = configuration_data()
57 sanitize_data.set(
58 'install_libexecdir',
59 join_paths(get_option('prefix'), get_option('libexecdir'))
60 )
61 configure_file(
62 input: 'intel_sanitize_gpu.in',
63 output: '@BASENAME@',
64 install_dir: get_option('bindir'),
65 install: build_intel_tools,
66 configuration: sanitize_data
67 )
68
69 libintel_sanitize_gpu = shared_library(
70 'intel_sanitize_gpu',
71 files('intel_sanitize_gpu.c'),
72 dependencies : [dep_dl, dep_thread],
73 include_directories : [inc_common, inc_intel, inc_drm_uapi],
74 link_with : [libintel_common, libmesa_util],
75 c_args : [c_vis_args, no_override_init_args],
76 build_by_default : build_intel_tools,
77 install_dir: get_option('libexecdir'),
78 install: build_intel_tools
79 )
80
81 configure_file(
82 input : 'intel_dump_gpu.in',
83 output : '@BASENAME@',
84 install_dir: get_option('bindir'),
85 configuration: sanitize_data,
86 install: build_intel_tools
87 )
88
89 libintel_dump_gpu = shared_library(
90 'intel_dump_gpu',
91 files('gen_context.h', 'gen8_context.h', 'gen10_context.h',
92 'intel_aub.h', 'aub_write.h', 'aub_write.c', 'intel_dump_gpu.c'),
93 dependencies : dep_dl,
94 include_directories : [inc_common, inc_intel, inc_drm_uapi],
95 link_with : libintel_dev,
96 c_args : [c_vis_args, no_override_init_args],
97 build_by_default : build_intel_tools,
98 install_dir: get_option('libexecdir'),
99 install: build_intel_tools
100 )