meson: Override C++ standard to gnu++11 when building with altivec on ppc64
[mesa.git] / src / gallium / state_trackers / clover / meson.build
1 # Copyright © 2017-2018 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 clover_cpp_args = []
22 clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux]
23
24 if with_opencl_icd
25 clover_cpp_args += '-DHAVE_CLOVER_ICD'
26 endif
27
28 libcltgsi = static_library(
29 'cltgsi',
30 files('tgsi/compiler.cpp', 'tgsi/invocation.hpp'),
31 include_directories : clover_incs,
32 cpp_args : [cpp_vis_args],
33 override_options : clover_cpp_std,
34 )
35
36 libclllvm = static_library(
37 'clllvm',
38 files(
39 'llvm/codegen/bitcode.cpp',
40 'llvm/codegen/common.cpp',
41 'llvm/codegen/native.cpp',
42 'llvm/codegen.hpp',
43 'llvm/compat.hpp',
44 'llvm/invocation.cpp',
45 'llvm/invocation.hpp',
46 'llvm/metadata.hpp',
47 'llvm/util.hpp',
48 ),
49 include_directories : clover_incs,
50 cpp_args : [
51 cpp_vis_args,
52 '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')),
53 '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')),
54 '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
55 dep_llvm.get_configtool_variable('libdir'), 'clang',
56 dep_llvm.get_configtool_variable('version'), 'include',
57 )),
58 ],
59 dependencies : [dep_llvm, dep_elf],
60 override_options : clover_cpp_std,
61 )
62
63 clover_files = files(
64 'api/context.cpp',
65 'api/device.cpp',
66 'api/dispatch.cpp',
67 'api/dispatch.hpp',
68 'api/event.cpp',
69 'api/interop.cpp',
70 'api/kernel.cpp',
71 'api/memory.cpp',
72 'api/platform.cpp',
73 'api/program.cpp',
74 'api/queue.cpp',
75 'api/sampler.cpp',
76 'api/transfer.cpp',
77 'api/util.hpp',
78 'core/context.cpp',
79 'core/context.hpp',
80 'core/device.cpp',
81 'core/device.hpp',
82 'core/error.hpp',
83 'core/event.cpp',
84 'core/event.hpp',
85 'core/format.cpp',
86 'core/format.hpp',
87 'core/kernel.cpp',
88 'core/kernel.hpp',
89 'core/memory.cpp',
90 'core/memory.hpp',
91 'core/module.cpp',
92 'core/module.hpp',
93 'core/object.hpp',
94 'core/platform.cpp',
95 'core/platform.hpp',
96 'core/program.cpp',
97 'core/program.hpp',
98 'core/property.hpp',
99 'core/queue.cpp',
100 'core/queue.hpp',
101 'core/resource.cpp',
102 'core/resource.hpp',
103 'core/sampler.cpp',
104 'core/sampler.hpp',
105 'core/timestamp.cpp',
106 'core/timestamp.hpp',
107 'util/adaptor.hpp',
108 'util/algebra.hpp',
109 'util/algorithm.hpp',
110 'util/factor.hpp',
111 'util/functional.hpp',
112 'util/lazy.hpp',
113 'util/pointer.hpp',
114 'util/range.hpp',
115 'util/tuple.hpp',
116 )
117
118 libclover = static_library(
119 'clover',
120 [clover_files, sha1_h],
121 include_directories : clover_incs,
122 cpp_args : [clover_cpp_args, cpp_vis_args],
123 link_with : [libcltgsi, libclllvm],
124 override_options : clover_cpp_std,
125 )