mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
tu: compile as C++
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
This commit is contained in:
parent
8baa7acd82
commit
c82ddf4f98
26 changed files with 56 additions and 35 deletions
|
|
@ -14,25 +14,25 @@ tu_entrypoints = custom_target(
|
|||
|
||||
|
||||
libtu_files = files(
|
||||
'tu_autotune.c',
|
||||
'tu_clear_blit.c',
|
||||
'tu_cmd_buffer.c',
|
||||
'tu_cs_breadcrumbs.c',
|
||||
'tu_cs.c',
|
||||
'tu_device.c',
|
||||
'tu_descriptor_set.c',
|
||||
'tu_dynamic_rendering.c',
|
||||
'tu_formats.c',
|
||||
'tu_image.c',
|
||||
'tu_knl.c',
|
||||
'tu_lrz.c',
|
||||
'tu_nir_lower_multiview.c',
|
||||
'tu_pass.c',
|
||||
'tu_pipeline.c',
|
||||
'tu_query.c',
|
||||
'tu_shader.c',
|
||||
'tu_suballoc.c',
|
||||
'tu_util.c',
|
||||
'tu_autotune.cc',
|
||||
'tu_clear_blit.cc',
|
||||
'tu_cmd_buffer.cc',
|
||||
'tu_cs_breadcrumbs.cc',
|
||||
'tu_cs.cc',
|
||||
'tu_device.cc',
|
||||
'tu_descriptor_set.cc',
|
||||
'tu_dynamic_rendering.cc',
|
||||
'tu_formats.cc',
|
||||
'tu_image.cc',
|
||||
'tu_knl.cc',
|
||||
'tu_lrz.cc',
|
||||
'tu_nir_lower_multiview.cc',
|
||||
'tu_pass.cc',
|
||||
'tu_pipeline.cc',
|
||||
'tu_query.cc',
|
||||
'tu_shader.cc',
|
||||
'tu_suballoc.cc',
|
||||
'tu_util.cc',
|
||||
)
|
||||
|
||||
tu_deps = []
|
||||
|
|
@ -55,11 +55,11 @@ if system_has_kms_drm and not with_platform_android
|
|||
endif
|
||||
|
||||
if tu_wsi
|
||||
libtu_files += 'tu_wsi.c'
|
||||
libtu_files += 'tu_wsi.cc'
|
||||
endif
|
||||
|
||||
if with_platform_android
|
||||
libtu_files += files('tu_android.c')
|
||||
libtu_files += files('tu_android.cc')
|
||||
tu_deps += [dep_android]
|
||||
endif
|
||||
|
||||
|
|
@ -69,21 +69,19 @@ endif
|
|||
|
||||
if freedreno_kmds.contains('kgsl')
|
||||
tu_flags += '-DTU_HAS_KGSL'
|
||||
libtu_files += files('tu_knl_kgsl.c')
|
||||
libtu_files += files('tu_knl_kgsl.cc')
|
||||
endif
|
||||
|
||||
if freedreno_kmds.contains('msm')
|
||||
tu_flags += '-DTU_HAS_MSM'
|
||||
libtu_files += files('tu_knl_drm_msm.c')
|
||||
libtu_files += files('tu_knl_drm_msm.cc')
|
||||
tu_deps += dep_libdrm
|
||||
endif
|
||||
|
||||
tu_flags += '-Wno-array-bounds'
|
||||
|
||||
tu_tracepoints = custom_target(
|
||||
'tu_tracepoints.[ch]',
|
||||
input: 'tu_tracepoints.py',
|
||||
output: ['tu_tracepoints.c', 'tu_tracepoints.h', 'tu_tracepoints_perfetto.h'],
|
||||
output: ['tu_tracepoints.cc', 'tu_tracepoints.h', 'tu_tracepoints_perfetto.h'],
|
||||
command: [
|
||||
prog_python, '@INPUT@',
|
||||
'-p', join_paths(dir_source_root, 'src/util/perf/'),
|
||||
|
|
@ -95,10 +93,40 @@ tu_tracepoints = custom_target(
|
|||
)
|
||||
|
||||
if with_perfetto
|
||||
libtu_files += ['tu_perfetto.cc', 'tu_perfetto_util.c']
|
||||
libtu_files += ['tu_perfetto.cc', 'tu_perfetto_util.cc']
|
||||
tu_deps += dep_perfetto
|
||||
endif
|
||||
|
||||
tu_cpp_args = []
|
||||
tu_cpp_args += cpp.get_supported_arguments([
|
||||
'-fno-exceptions',
|
||||
'-fno-rtti',
|
||||
'-Wno-address-of-temporary',
|
||||
'-Wno-array-bounds',
|
||||
'-Wno-c99-designator',
|
||||
'-Wno-class-memaccess',
|
||||
'-Wno-missing-braces',
|
||||
'-Wno-narrowing',
|
||||
'-Wno-pointer-arith',
|
||||
'-Wno-reorder-init-list',
|
||||
'-Wno-sign-compare',
|
||||
'-Wno-switch',
|
||||
'-Wno-unused-function',
|
||||
'-Wno-writable-strings',
|
||||
'-Wno-write-strings',
|
||||
])
|
||||
|
||||
# HACK compiler.get_supported_arguments()/has_argument() do not seem
|
||||
# to be reliable for cross builds (!?!) so just jam in some args we
|
||||
# need and hope for the best
|
||||
if meson.is_cross_build()
|
||||
tu_cpp_args += '-Wno-array-bounds'
|
||||
tu_cpp_args += '-Wno-c++11-narrowing'
|
||||
tu_cpp_args += '-Wno-missing-braces'
|
||||
tu_cpp_args += '-Wno-unused-function'
|
||||
tu_cpp_args += '-Wno-writable-strings'
|
||||
endif
|
||||
|
||||
libvulkan_freedreno = shared_library(
|
||||
'vulkan_freedreno',
|
||||
[libtu_files, tu_entrypoints, tu_tracepoints, freedreno_xml_header_files, sha1_h, u_format_pack_h],
|
||||
|
|
@ -132,6 +160,7 @@ libvulkan_freedreno = shared_library(
|
|||
idep_mesautil,
|
||||
],
|
||||
c_args : [no_override_init_args, tu_flags],
|
||||
cpp_args : [tu_cpp_args, tu_flags],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
link_args : [vulkan_icd_link_args, ld_args_bsymbolic, ld_args_gc_sections, ld_args_build_id],
|
||||
link_depends : vulkan_icd_link_depends,
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@
|
|||
|
||||
/* we can't include tu_knl.h and tu_device.h */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int
|
||||
tu_device_get_gpu_timestamp(struct tu_device *dev,
|
||||
uint64_t *ts);
|
||||
|
|
@ -31,10 +27,6 @@ tu_device_ticks_to_ns(struct tu_device *dev, uint64_t ts);
|
|||
struct u_trace_context *
|
||||
tu_device_get_u_trace(struct tu_device *device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Queue-id's
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue