Path: blob/21.2-virgl/src/microsoft/clc/meson.build
4560 views
# Copyright © Microsoft Corporation12# Permission is hereby granted, free of charge, to any person obtaining a3# copy of this software and associated documentation files (the "Software"),4# to deal in the Software without restriction, including without limitation5# the rights to use, copy, modify, merge, publish, distribute, sublicense,6# and/or sell copies of the Software, and to permit persons to whom the7# Software is furnished to do so, subject to the following conditions:89# The above copyright notice and this permission notice (including the next10# paragraph) shall be included in all copies or substantial portions of the11# Software.1213# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING18# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS19# IN THE SOFTWARE.2021clang_ver_dir = dep_clang.version()22if clang_ver_dir.endswith('git')23clang_ver_dir = clang_ver_dir.substring(0, -3)24endif2526clang_resource_dir = join_paths(27dep_clang.get_variable(cmake: 'CLANG_INCLUDE_DIRS'), '..',28'lib', 'clang', clang_ver_dir, 'include'29)3031opencl_c_h = custom_target(32'opencl-c.h',33input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c.h')],34output : 'opencl-c.h.h',35command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_source'],36)37opencl_c_base_h = custom_target(38'opencl-c-base.h',39input : [files_xxd, join_paths(clang_resource_dir, 'opencl-c-base.h')],40output : 'opencl-c-base.h.h',41command : [prog_python, '@INPUT@', '@OUTPUT@', '-n', 'opencl_c_base_source'],42)4344files_libclc_compiler = files(45'clc_compiler.c',46'clc_nir.c',47'clc_helpers.cpp'48)4950libclc_compiler = shared_library(51'clglon12compiler',52[files_libclc_compiler, sha1_h],53opencl_c_h,54opencl_c_base_h,55vs_module_defs : 'clglon12compiler.def',56include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_compiler, inc_gallium, inc_spirv],57dependencies: [idep_nir_headers, dep_clang, dep_llvm, cc.find_library('version'),58dep_llvmspirvlib, idep_mesautil, idep_libdxil_compiler, idep_nir, dep_spirv_tools]59)6061if dep_dxheaders.found()62clc_compiler_test = executable('clc_compiler_test',63['clc_compiler_test.cpp', 'compute_test.cpp'],64link_with : [libclc_compiler],65dependencies : [idep_gtest, idep_mesautil, idep_libdxil_compiler, dep_dxheaders],66include_directories : [inc_include, inc_src])6768test('clc_compiler_test', clc_compiler_test, timeout: 180)69endif707172