1# Copyright © 2017-2018 Intel Corporation 2# SPDX-License-Identifier: MIT 3 4clover_cpp_args = [] 5clover_opencl_cpp_args = [ 6 '-DCL_TARGET_OPENCL_VERSION=300', 7 '-DCL_USE_DEPRECATED_OPENCL_1_0_APIS', 8 '-DCL_USE_DEPRECATED_OPENCL_1_1_APIS', 9 '-DCL_USE_DEPRECATED_OPENCL_1_2_APIS', 10 '-DCL_USE_DEPRECATED_OPENCL_2_0_APIS', 11 '-DCL_USE_DEPRECATED_OPENCL_2_1_APIS', 12 '-DCL_USE_DEPRECATED_OPENCL_2_2_APIS', 13 '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'includedir')), 14 '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'libexecdir')) 15] 16clover_spirv_cpp_args = [] 17clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux] 18 19# the CL header files declare attributes on the CL types. Compilers warn if 20# we use them as template arguments. Disable the warning as there isn't 21# anything we can do about it 22if cpp.has_argument('-Wno-ignored-attributes') 23 clover_cpp_args += '-Wno-ignored-attributes' 24endif 25 26if with_opencl_icd 27 clover_cpp_args += '-DHAVE_CLOVER_ICD' 28endif 29 30if with_clover_spirv 31 clover_spirv_cpp_args += '-DHAVE_CLOVER_SPIRV' 32endif 33 34libclllvm = static_library( 35 'clllvm', 36 files( 37 'llvm/codegen/bitcode.cpp', 38 'llvm/codegen/common.cpp', 39 'llvm/codegen/native.cpp', 40 'llvm/codegen.hpp', 41 'llvm/compat.hpp', 42 'llvm/invocation.cpp', 43 'llvm/invocation.hpp', 44 'llvm/metadata.hpp', 45 'llvm/util.hpp', 46 ), 47 include_directories : clover_incs, 48 cpp_args : [ 49 clover_cpp_args, 50 clover_opencl_cpp_args, 51 clover_spirv_cpp_args, 52 '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths( 53 dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang', 54 dep_llvm.version(), 'include', 55 )), 56 ], 57 gnu_symbol_visibility : 'hidden', 58 dependencies : [dep_llvm, dep_elf, dep_llvmspirvlib, idep_mesautil], 59) 60 61idep_opencl_spirv = null_dep 62if with_clover_spirv 63 libclspirv = static_library( 64 'clspirv', 65 files('spirv/invocation.cpp', 'spirv/invocation.hpp'), 66 include_directories : clover_incs, 67 cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args], 68 gnu_symbol_visibility : 'hidden', 69 dependencies : [dep_spirv_tools, idep_mesautil], 70 ) 71 72 libclnir = static_library( 73 'clnir', 74 files('nir/invocation.cpp', 'nir/invocation.hpp'), 75 include_directories : [clover_incs, inc_mesa], 76 dependencies : [idep_nir, idep_vtn, idep_mesaclc], 77 cpp_args : [clover_opencl_cpp_args, clover_spirv_cpp_args], 78 gnu_symbol_visibility : 'hidden', 79 ) 80 81 idep_opencl_spirv = declare_dependency( 82 dependencies : [idep_nir], 83 link_with : [libclspirv, libclnir], 84 ) 85endif 86 87clover_files = files( 88 'api/context.cpp', 89 'api/device.cpp', 90 'api/dispatch.cpp', 91 'api/dispatch.hpp', 92 'api/event.cpp', 93 'api/interop.cpp', 94 'api/invalid.cpp', 95 'api/kernel.cpp', 96 'api/memory.cpp', 97 'api/platform.cpp', 98 'api/program.cpp', 99 'api/queue.cpp', 100 'api/sampler.cpp', 101 'api/transfer.cpp', 102 'api/util.hpp', 103 'core/binary.cpp', 104 'core/binary.hpp', 105 'core/compiler.hpp', 106 'core/context.cpp', 107 'core/context.hpp', 108 'core/device.cpp', 109 'core/device.hpp', 110 'core/error.hpp', 111 'core/event.cpp', 112 'core/event.hpp', 113 'core/format.cpp', 114 'core/format.hpp', 115 'core/kernel.cpp', 116 'core/kernel.hpp', 117 'core/memory.cpp', 118 'core/memory.hpp', 119 'core/object.hpp', 120 'core/platform.cpp', 121 'core/platform.hpp', 122 'core/printf.cpp', 123 'core/printf.hpp', 124 'core/program.cpp', 125 'core/program.hpp', 126 'core/property.hpp', 127 'core/queue.cpp', 128 'core/queue.hpp', 129 'core/resource.cpp', 130 'core/resource.hpp', 131 'core/sampler.cpp', 132 'core/sampler.hpp', 133 'core/timestamp.cpp', 134 'core/timestamp.hpp', 135 'util/adaptor.hpp', 136 'util/algebra.hpp', 137 'util/algorithm.hpp', 138 'util/compat.hpp', 139 'util/factor.hpp', 140 'util/functional.hpp', 141 'util/lazy.hpp', 142 'util/pointer.hpp', 143 'util/range.hpp', 144 'util/tuple.hpp', 145) 146 147libclover = static_library( 148 'clover', 149 [clover_files, sha1_h], 150 include_directories : clover_incs, 151 cpp_args : [ 152 clover_opencl_cpp_args, 153 clover_spirv_cpp_args, 154 clover_cpp_args, 155 ], 156 gnu_symbol_visibility : 'hidden', 157 link_with : [libclllvm], 158 dependencies : [idep_mesautil, idep_nir, idep_opencl_spirv], 159) 160