1b8e80941Smrg# Copyright © 2017 Intel Corporation
2b8e80941Smrg
3b8e80941Smrg# Permission is hereby granted, free of charge, to any person obtaining a copy
4b8e80941Smrg# of this software and associated documentation files (the "Software"), to deal
5b8e80941Smrg# in the Software without restriction, including without limitation the rights
6b8e80941Smrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7b8e80941Smrg# copies of the Software, and to permit persons to whom the Software is
8b8e80941Smrg# furnished to do so, subject to the following conditions:
9b8e80941Smrg
10b8e80941Smrg# The above copyright notice and this permission notice shall be included in
11b8e80941Smrg# all copies or substantial portions of the Software.
12b8e80941Smrg
13b8e80941Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14b8e80941Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15b8e80941Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16b8e80941Smrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17b8e80941Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18b8e80941Smrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19b8e80941Smrg# SOFTWARE.
20b8e80941Smrg
21b8e80941Smrginc_compiler = include_directories('.')
22b8e80941Smrginc_nir = include_directories('nir')
23b8e80941Smrginc_glsl = include_directories('glsl')
24b8e80941Smrginc_spirv = include_directories('spirv')
25b8e80941Smrg
26b8e80941Smrgfiles_libcompiler = files(
27b8e80941Smrg  'blob.c',
28b8e80941Smrg  'blob.h',
29b8e80941Smrg  'builtin_type_macros.h',
30b8e80941Smrg  'glsl_types.cpp',
31b8e80941Smrg  'glsl_types.h',
32b8e80941Smrg  'nir_types.cpp',
33b8e80941Smrg  'nir_types.h',
34b8e80941Smrg  'shader_enums.c',
35b8e80941Smrg  'shader_enums.h',
36b8e80941Smrg  'shader_info.h',
37b8e80941Smrg)
38b8e80941Smrg
39b8e80941Smrgir_expression_operation_h = custom_target(
40b8e80941Smrg  'ir_expression_operation.h',
41b8e80941Smrg  input : 'glsl/ir_expression_operation.py',
42b8e80941Smrg  output : 'ir_expression_operation.h',
43b8e80941Smrg  command : [prog_python, '@INPUT@', 'enum'],
44b8e80941Smrg  capture : true,
45b8e80941Smrg)
46b8e80941Smrg
47b8e80941Smrglibcompiler = static_library(
48b8e80941Smrg  'compiler',
49b8e80941Smrg  [files_libcompiler, ir_expression_operation_h],
50b8e80941Smrg  include_directories : [inc_mapi, inc_mesa, inc_compiler, inc_common],
51b8e80941Smrg  c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
52b8e80941Smrg  cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
53b8e80941Smrg  dependencies : [dep_valgrind],
54b8e80941Smrg  build_by_default : false,
55b8e80941Smrg)
56b8e80941Smrg
57b8e80941Smrgsubdir('spirv')
58b8e80941Smrg
59b8e80941Smrgsubdir('nir')
60b8e80941Smrg
61b8e80941Smrg# This is here because putting it in spirv/meson.build would create a circular
62b8e80941Smrg# dependency with nir/meson.build.
63b8e80941Smrgspirv2nir = executable(
64b8e80941Smrg  'spirv2nir',
65b8e80941Smrg  files('spirv/spirv2nir.c'),
66b8e80941Smrg  dependencies : [dep_m, dep_thread, idep_nir],
67b8e80941Smrg  include_directories : [inc_common, inc_nir, include_directories('spirv')],
68b8e80941Smrg  link_with : libmesa_util,
69b8e80941Smrg  c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
70b8e80941Smrg  build_by_default : with_tools.contains('nir'),
71b8e80941Smrg  install : with_tools.contains('nir'),
72b8e80941Smrg)
73b8e80941Smrg
74b8e80941Smrgsubdir('glsl')
75