Module: Mesa
Branch: staging/22.2
Commit: 46cf9fdb8010a57996dab02575ce4ba381230711
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=46cf9fdb8010a57996dab02575ce4ba381230711

Author: Eric Engestrom <[email protected]>
Date:   Mon Aug 22 21:03:15 2022 +0100

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 <[email protected]>
Reviewed-by: Jesse Natalie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18190>
(cherry picked from commit c66622de3af4efc3717131c55a54b408bc7faade)

---

 .pick_status.json                              | 2 +-
 src/egl/meson.build                            | 5 ++++-
 src/freedreno/ds/meson.build                   | 2 +-
 src/gallium/drivers/r600/meson.build           | 3 ++-
 src/gallium/drivers/r600/sfn/tests/meson.build | 3 ++-
 src/intel/ds/meson.build                       | 4 ++--
 src/panfrost/ds/meson.build                    | 2 +-
 src/tool/pps/meson.build                       | 6 +++---
 8 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 7d4a2f761ab..8ccb489c4ac 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -11065,7 +11065,7 @@
         "description": "meson: replace manual compiler flags with meson 
arguments",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/egl/meson.build b/src/egl/meson.build
index be55ac7ab7f..c04d36302b7 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -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],
diff --git a/src/freedreno/ds/meson.build b/src/freedreno/ds/meson.build
index 50f099a9e07..ad210bef9da 100644
--- a/src/freedreno/ds/meson.build
+++ b/src/freedreno/ds/meson.build
@@ -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(
diff --git a/src/gallium/drivers/r600/meson.build 
b/src/gallium/drivers/r600/meson.build
index eb01c79a2b9..88181642dfa 100644
--- a/src/gallium/drivers/r600/meson.build
+++ b/src/gallium/drivers/r600/meson.build
@@ -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,
diff --git a/src/gallium/drivers/r600/sfn/tests/meson.build 
b/src/gallium/drivers/r600/sfn/tests/meson.build
index ba00dc58c05..d9d19f3c856 100644
--- a/src/gallium/drivers/r600/sfn/tests/meson.build
+++ b/src/gallium/drivers/r600/sfn/tests/meson.build
@@ -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']
     )
diff --git a/src/intel/ds/meson.build b/src/intel/ds/meson.build
index 64b6c9e36eb..ea9da889a12 100644
--- a/src/intel/ds/meson.build
+++ b/src/intel/ds/meson.build
@@ -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']
diff --git a/src/panfrost/ds/meson.build b/src/panfrost/ds/meson.build
index 379a25c4d26..9a8bdaf08ec 100644
--- a/src/panfrost/ds/meson.build
+++ b/src/panfrost/ds/meson.build
@@ -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']
diff --git a/src/tool/pps/meson.build b/src/tool/pps/meson.build
index e0e0361d6f2..4261fbc4ef5 100644
--- a/src/tool/pps/meson.build
+++ b/src/tool/pps/meson.build
@@ -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

Reply via email to