meson: replace manual compiler flags with meson arguments

These would only have worked in GCC and Clang, which so far wasn't an
issue, but let's clean it up anyway.

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18190>
This commit is contained in:
Eric Engestrom 2022-08-22 21:03:15 +01:00 committed by Marge Bot
parent 76bcf69e33
commit c66622de3a
7 changed files with 15 additions and 10 deletions

View File

@ -23,6 +23,7 @@ inc_egl_dri2 = include_directories('drivers/dri2')
c_args_for_egl = [asan_c_args]
cpp_args_for_egl = []
override_for_egl = []
link_for_egl = []
deps_for_egl = []
incs_for_egl = [inc_include, inc_src, inc_egl]
@ -131,7 +132,8 @@ if with_dri2
if dep_android_mapper4.found()
files_egl += files('drivers/dri2/platform_android_mapper.cpp')
c_args_for_egl += '-DUSE_IMAPPER4_METADATA_API'
cpp_args_for_egl += ['-std=c++17', '-DUSE_IMAPPER4_METADATA_API']
cpp_args_for_egl += '-DUSE_IMAPPER4_METADATA_API'
override_for_egl += 'cpp_std=c++17'
endif
endif
elif with_platform_haiku
@ -194,6 +196,7 @@ libegl = shared_library(
'-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()),
],
cpp_args : [cpp_args_for_egl],
override_options : override_for_egl,
gnu_symbol_visibility : 'hidden',
include_directories : incs_for_egl,
link_with : [link_for_egl, libglapi],

View File

@ -21,7 +21,7 @@ pps_freedreno_lib = static_library(
dep_perfetto,
dep_valgrind,
],
cpp_args: '-std=c++17'
override_options: ['cpp_std=c++17']
)
pps_freedreno_dep = declare_dependency(

View File

@ -193,7 +193,7 @@ if with_gallium_opencl
r600_c_args += '-DHAVE_OPENCL'
endif
r600_cpp_args = ['-std=c++17']
r600_cpp_args = []
if cpp.has_type('std::pmr::monotonic_buffer_resource',
args:['-std=c++17'],
prefix : '#include <memory_resource>')
@ -205,6 +205,7 @@ libr600 = static_library(
[files_r600, egd_tables_h],
c_args : [r600_c_args, '-Wstrict-overflow=0'],
cpp_args: r600_cpp_args,
override_options: ['cpp_std=c++17'],
gnu_symbol_visibility : 'hidden',
include_directories : [
inc_src, inc_mapi, inc_mesa, inc_include, inc_compiler, inc_gallium, inc_gallium_aux, inc_amd_common,

View File

@ -1,6 +1,7 @@
r600_test_lib = static_library('r600_test', 'sfn_test_shaders.cpp',
cpp_args: r600_cpp_args,
override_options: ['cpp_std=c++17'],
include_directories : [ inc_src, inc_mapi, inc_mesa, inc_include,
inc_compiler, inc_gallium, inc_gallium_aux, inc_amd_common,
inc_gallium_drivers, ],
@ -28,7 +29,7 @@ if with_tests
executable('test-@0@-r600-sfn'.format(t),
['sfn_@0@_test.cpp'.format(t)],
dependencies : [r600_test_dep],
cpp_args: '-std=c++17'
override_options: ['cpp_std=c++17']
),
suite : ['r600']
)

View File

@ -39,7 +39,7 @@ libintel_driver_ds = static_library(
include_directories : [inc_src, inc_include, inc_intel, inc_mapi, inc_mesa],
link_with : [libintel_perf, libintel_dev],
dependencies : libintel_driver_ds_deps,
cpp_args : '-std=c++17',
override_options : ['cpp_std=c++17'],
gnu_symbol_visibility : 'hidden',
)
@ -61,7 +61,7 @@ if with_perfetto and (with_datasources.contains('intel') or with_datasources.con
include_directories: [inc_tool, inc_src, inc_include, inc_intel],
link_with: [libintel_perf, libintel_dev],
dependencies: [dep_perfetto, dep_libdrm, idep_mesautil],
cpp_args: '-std=c++17'
override_options: ['cpp_std=c++17']
)
compile_args_pps_intel = ['-DPPS_INTEL']

View File

@ -16,7 +16,7 @@ pps_panfrost_lib = static_library(
sources: pps_panfrost_sources,
include_directories: pps_panfrost_includes,
dependencies: [dep_libdrm, dep_perfetto, libpanfrost_dep, dep_panfrost_perf],
cpp_args: '-std=c++17'
override_options: ['cpp_std=c++17']
)
compile_args_pps_panfrost = ['-DPPS_PANFROST']

View File

@ -21,7 +21,7 @@ lib_pps = static_library(
sources: pps_sources,
include_directories: [include_pps, inc_src, pps_includes],
dependencies: pps_deps,
cpp_args: '-std=c++17'
override_options: ['cpp_std=c++17'],
)
dep_pps = declare_dependency(
@ -39,7 +39,7 @@ executable(
sources: producer_sources,
include_directories: [include_pps, inc_src],
dependencies: [dep_pps, dep_perfetto],
cpp_args: '-std=c++17',
override_options: ['cpp_std=c++17'],
install: true
)
@ -55,7 +55,7 @@ if dep_docopt.found()
sources: config_sources,
include_directories: [include_pps, inc_src],
dependencies: [dep_pps, dep_docopt],
cpp_args: '-std=c++17',
override_options: ['cpp_std=c++17'],
install: true
)
endif