mesa/src/panfrost/genxml/meson.build
Valentine Burley 190ce8280f
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
meson: Add Soong compatibility compiler flags to Vulkan drivers
Suggested by @gurchetansingh.

Android's Soong build system treats several compiler warnings as errors
by default: https://android.googlesource.com/platform/build/soong/+/27f57506/cc/config/global.go/#218

To catch these issues in Mesa, introduce `soong_compat_c_args`
and `soong_compat_cpp_args` with the following flags treated as errors:
 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
 -Werror=date-time
 -Werror=gnu-alignof-expression
 -Werror=ignored-qualifiers
 -Werror=implicit-fallthrough
 -Werror=int-conversion
 -Werror=missing-prototypes
 -Werror=pragma-pack
 -Werror=pragma-pack-suspicious-include
 -Werror=sizeof-array-div
 -Werror=string-plus-int
 -Werror=unreachable-code-loop-increment

These compatibility flags are added to the meson configurations
for ANV, Gfxstream, Lavapipe, PanVK, Turnip, and Venus.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41644>
2026-05-22 07:09:49 +00:00

63 lines
1.9 KiB
Meson

# Copyright © 2018 Rob Clark
# Copyright © 2019 Collabora
# SPDX-License-Identifier: MIT
pan_packers = []
foreach packer : ['common', 'v4', 'v5', 'v6', 'v7', 'v9', 'v10', 'v12', 'v13', 'v14']
pan_packers += custom_target(
packer + '_pack.h',
input : ['gen_pack.py', packer + '.xml'],
output : packer + '_pack.h',
command : [prog_python, '@INPUT@'],
capture : true,
)
endforeach
idep_pan_packers = declare_dependency(
sources : [pan_packers],
include_directories : include_directories('.'),
)
libpanfrost_decode_per_arch = []
foreach ver : ['4', '5', '6', '7', '9', '10', '12', '13', '14']
libpanfrost_decode_per_arch += static_library(
'pandecode-arch-v' + ver,
['decode.c', 'decode_jm.c', 'decode_csf.c', pan_packers],
include_directories : [inc_include, inc_src, inc_panfrost],
dependencies : [dep_libdrm, idep_pan_packers, idep_nir, idep_mesautil],
c_args : [no_override_init_args, soong_compat_c_args, '-DPAN_ARCH=' + ver],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
endforeach
libpanfrost_decode = static_library(
'panfrost_decode',
[
'decode_common.c',
pan_packers
],
include_directories : [inc_include, inc_src, inc_panfrost],
dependencies : idep_mesautil,
c_args : [no_override_init_args, soong_compat_c_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
link_with: [libpanfrost_decode_per_arch],
)
if with_tests
test('cs_builder_tests',
executable(
'cs_builder_tests',
['test/cs_builder.cpp'],
# Nothing arch-specific is tested currently, only compile v10.
cpp_args : [cpp_msvc_compat_args, '-DPAN_ARCH=10'],
gnu_symbol_visibility : 'hidden',
include_directories: [inc_include, inc_src, inc_panfrost],
dependencies: [idep_gtest, idep_pan_packers, idep_mesautil],
),
suite: ['panfrost'],
protocol: 'gtest',
)
endif