diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/pipe-loader/meson.build | 3 | ||||
-rw-r--r-- | src/gallium/meson.build | 12 | ||||
-rw-r--r-- | src/gallium/state_trackers/clover/meson.build | 122 | ||||
-rw-r--r-- | src/gallium/targets/opencl/meson.build | 73 | ||||
-rw-r--r-- | src/gallium/targets/pipe-loader/meson.build | 77 |
5 files changed, 285 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/meson.build b/src/gallium/auxiliary/pipe-loader/meson.build index 9b12432aea0..869a2935149 100644 --- a/src/gallium/auxiliary/pipe-loader/meson.build +++ b/src/gallium/auxiliary/pipe-loader/meson.build @@ -60,7 +60,8 @@ libpipe_loader_dynamic = static_library( ], c_args : [ c_vis_args, libpipe_loader_defines, '-DHAVE_PIPE_LOADER_DRI', - '-DPIPE_SEARCH_DIR="@0@"'.format(join_paths(get_option('libdir'), 'gallium-pipe') + '-DPIPE_SEARCH_DIR="@0@"'.format( + join_paths(get_option('prefix'), get_option('libdir'), 'gallium-pipe') ) ], link_with : [libloader, libxmlconfig], diff --git a/src/gallium/meson.build b/src/gallium/meson.build index fc21dcf03e1..6330c7514af 100644 --- a/src/gallium/meson.build +++ b/src/gallium/meson.build @@ -145,7 +145,17 @@ endif if with_gallium_st_nine subdir('state_trackers/nine') endif -# TODO: clover +if with_gallium_opencl + # TODO: this isn't really clover specific, but ATM clover is the only + # consumer + subdir('targets/pipe-loader') + + if meson.version().version_compare('< 0.44.0') + error('OpenCL requires meson 0.44.0 or greater.') + endif + subdir('state_trackers/clover') + subdir('targets/opencl') +endif if with_dri subdir('state_trackers/dri') subdir('targets/dri') diff --git a/src/gallium/state_trackers/clover/meson.build b/src/gallium/state_trackers/clover/meson.build new file mode 100644 index 00000000000..d1497e657ea --- /dev/null +++ b/src/gallium/state_trackers/clover/meson.build @@ -0,0 +1,122 @@ +# Copyright © 2017-2018 Intel Corporation + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +clover_cpp_args = [] +clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux] + +if with_opencl_icd + clover_cpp_args += '-DHAVE_CLOVER_ICD' +endif + +libcltgsi = static_library( + 'cltgsi', + files('tgsi/compiler.cpp', 'tgsi/invocation.hpp'), + include_directories : clover_incs, + cpp_args : [cpp_vis_args], +) + +libclllvm = static_library( + 'clllvm', + files( + 'llvm/codegen/bitcode.cpp', + 'llvm/codegen/common.cpp', + 'llvm/codegen/native.cpp', + 'llvm/codegen.hpp', + 'llvm/compat.hpp', + 'llvm/invocation.cpp', + 'llvm/invocation.hpp', + 'llvm/metadata.hpp', + 'llvm/util.hpp', + ), + include_directories : clover_incs, + cpp_args : [ + cpp_vis_args, + '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir')), + '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('libexecdir')), + '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths( + dep_llvm.get_configtool_variable('libdir'), 'clang', + dep_llvm.get_configtool_variable('version'), 'include', + )), + ], + dependencies : [dep_llvm, dep_elf], +) + +clover_files = files( + 'api/context.cpp', + 'api/device.cpp', + 'api/dispatch.cpp', + 'api/dispatch.hpp', + 'api/event.cpp', + 'api/interop.cpp', + 'api/kernel.cpp', + 'api/memory.cpp', + 'api/platform.cpp', + 'api/program.cpp', + 'api/queue.cpp', + 'api/sampler.cpp', + 'api/transfer.cpp', + 'api/util.hpp', + 'core/context.cpp', + 'core/context.hpp', + 'core/device.cpp', + 'core/device.hpp', + 'core/error.hpp', + 'core/event.cpp', + 'core/event.hpp', + 'core/format.cpp', + 'core/format.hpp', + 'core/kernel.cpp', + 'core/kernel.hpp', + 'core/memory.cpp', + 'core/memory.hpp', + 'core/module.cpp', + 'core/module.hpp', + 'core/object.hpp', + 'core/platform.cpp', + 'core/platform.hpp', + 'core/program.cpp', + 'core/program.hpp', + 'core/property.hpp', + 'core/queue.cpp', + 'core/queue.hpp', + 'core/resource.cpp', + 'core/resource.hpp', + 'core/sampler.cpp', + 'core/sampler.hpp', + 'core/timestamp.cpp', + 'core/timestamp.hpp', + 'util/adaptor.hpp', + 'util/algebra.hpp', + 'util/algorithm.hpp', + 'util/factor.hpp', + 'util/functional.hpp', + 'util/lazy.hpp', + 'util/pointer.hpp', + 'util/range.hpp', + 'util/tuple.hpp', +) + +libclover = static_library( + 'clover', + clover_files, + include_directories : clover_incs, + cpp_args : [clover_cpp_args, cpp_vis_args], + link_with : [libcltgsi, libclllvm], +) diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build new file mode 100644 index 00000000000..bebe0547d45 --- /dev/null +++ b/src/gallium/targets/opencl/meson.build @@ -0,0 +1,73 @@ +# Copyright © 2017 Intel Corporation + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +opencl_link_args = [] +opencl_link_deps = [] +opencl_version = '1.0' + +if with_ld_version_script + opencl_link_args += [ + '-Wl,--version-script', join_paths(meson.current_source_dir(), 'opencl.sym') + ] + opencl_link_deps += files('opencl.sym') +endif + +llvm_libdir = dep_llvm.get_configtool_variable('libdir') + +opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL' + +libopencl = shared_library( + opencl_libname, + [], + link_args : [ld_args_gc_sections, opencl_link_args], + link_depends : opencl_link_deps, + link_whole : libclover, + link_with : [libpipe_loader_dynamic, libgallium, libmesa_util], + dependencies : [ + dep_thread, dep_clock, dep_dl, dep_unwind, dep_elf, dep_expat, + cpp.find_library('clangCodeGen', dirs : llvm_libdir), + cpp.find_library('clangFrontendTool', dirs : llvm_libdir), + cpp.find_library('clangFrontend', dirs : llvm_libdir), + cpp.find_library('clangDriver', dirs : llvm_libdir), + cpp.find_library('clangSerialization', dirs : llvm_libdir), + cpp.find_library('clangParse', dirs : llvm_libdir), + cpp.find_library('clangSema', dirs : llvm_libdir), + cpp.find_library('clangAnalysis', dirs : llvm_libdir), + cpp.find_library('clangAST', dirs : llvm_libdir), + cpp.find_library('clangEdit', dirs : llvm_libdir), + cpp.find_library('clangLex', dirs : llvm_libdir), + cpp.find_library('clangBasic', dirs : llvm_libdir), + ], + version : opencl_version, + install : true, +) + +if with_opencl_icd + _config = configuration_data() + _config.set('OPENCL_LIBNAME', 'MesaOpenCL') + _config.set('OPENCL_VERSION', opencl_version) + configure_file( + configuration : _config, + input : 'mesa.icd.in', + output : 'mesa.icd', + install : true, + install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'), + ) +endif diff --git a/src/gallium/targets/pipe-loader/meson.build b/src/gallium/targets/pipe-loader/meson.build new file mode 100644 index 00000000000..6141d4374fe --- /dev/null +++ b/src/gallium/targets/pipe-loader/meson.build @@ -0,0 +1,77 @@ +# Copyright © 2017 Intel Corporation + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +pipe_loader_link_args = [ld_args_gc_sections] +pipe_loader_link_deps = [] +pipe_loader_link_with = [libgallium, libnir, libmesa_util, librbug, libtrace] +pipe_loader_comp_args = ['-DGALLIUM_RBUG', '-DGALLIUM_TRACE'] +pipe_loader_incs = [ + inc_include, inc_src, inc_util, inc_gallium, inc_gallium_drivers, + inc_gallium_winsys, inc_gallium_aux, +] + +if (with_gallium_va or with_gallium_vdpau or with_gallium_omx or + with_gallium_xvmc or with_dri) + pipe_loader_link_with += libgalliumvl +else + pipe_loader_link_with += libgalliumvl_stubs +endif +if with_gallium_va or with_gallium_vdpau or with_gallium_omx or with_gallium_xvmc + pipe_loader_link_with += libgalliumvlwinsys +endif + +if with_ld_version_script + pipe_loader_link_args += [ + '-Wl,--version-script', join_paths(meson.current_source_dir(), 'pipe.sym') + ] + pipe_loader_link_deps += files('pipe.sym') +endif + +pipe_loader_install_dir = join_paths(get_option('libdir'), 'gallium-pipe') + +pipe_loaders = [ + [with_gallium_i915, 'i915', driver_i915, []], + [with_gallium_nouveau, 'nouveau', driver_nouveau, []], + [with_gallium_r300, 'r300', driver_r300, []], + [with_gallium_r600, 'r600', driver_r600, []], + [with_gallium_radeonsi, 'radeonsi', driver_radeonsi, [libxmlconfig]], + [with_gallium_freedreno, 'msm', driver_freedreno, []], + [with_gallium_svga, 'vmwgfx', driver_svga, []], + [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null]], +] + +foreach x : pipe_loaders + if x[0] + shared_library( + 'pipe_@0@'.format(x[1]), + 'pipe_@[email protected]'.format(x[1]), + c_args : [pipe_loader_comp_args, c_vis_args], + cpp_args : [pipe_loader_comp_args, cpp_vis_args], + link_args : pipe_loader_link_args, + link_depends : pipe_loader_link_deps, + include_directories : pipe_loader_incs, + link_with : [pipe_loader_link_with, x[3]], + dependencies : [dep_thread, x[2]], + name_prefix : '', + install : true, + install_dir : pipe_loader_install_dir, + ) + endif +endforeach |