Skip to contentSkip to conversation

meson.build: Use -Wno-undef only for SDL 2.0.8 and older

PATCH In review Thomas Huth 2 participants 3 messages May 31, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson.build: Use -Wno-undef only for SDL 2.0.8 and older

There is no need to disable this useful compiler warning for newer versions of the SDL anymore.

This also enables the printing of the version number with newer versions of the SDL in the summary of the meson output again.

---
 meson.build | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meson.build +6 -4
index bc76ea96bf..8ccd928dca 100644
@@ -1273,10 +1273,12 @@ if not get_option('sdl').auto() or have_system
   sdl_image = not_found
 endif
 if sdl.found()
-  # work around 2.0.8 bug
-  sdl = declare_dependency(compile_args: '-Wno-undef',
-                           dependencies: sdl,
-                           version: sdl.version())
+  if sdl.version().version_compare('<=2.0.8')
+    # work around 2.0.8 bug
+    sdl = declare_dependency(compile_args: '-Wno-undef',
+                             dependencies: sdl,
+                             version: sdl.version())
+  endif
   sdl_image = dependency('SDL2_image', required: get_option('sdl_image'),
                          method: 'pkg-config')
 else
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Thomas Huth

There is no need to disable this useful compiler warning for newer versions of the SDL anymore.

This also enables the printing of the version number with newer versions of the SDL in the summary of the meson output again.

Quoted 30 lines
---
 meson.build | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meson.build +6 -5
index bc76ea96bf..8ccd928dca 100644
@@ -1273,10 +1273,12 @@ if not get_option('sdl').auto() or have_system
   sdl_image = not_found
 endif
 if sdl.found()
-  # work around 2.0.8 bug
-  sdl = declare_dependency(compile_args: '-Wno-undef',
-                           dependencies: sdl,
-                           version: sdl.version())
+  if sdl.version().version_compare('<=2.0.8')
+    # work around 2.0.8 bug
+    sdl = declare_dependency(compile_args: '-Wno-undef',
+                             dependencies: sdl,
+                             version: sdl.version())
+  endif
   sdl_image = dependency('SDL2_image', required: get_option('sdl_image'),
                          method: 'pkg-config')
 else
--

2.31.1

Signature · 1 line
Marc-André Lureau
#2 lore raw
In reply to Thomas Huth
Quoted 20 lines · Thomas Huth

There is no need to disable this useful compiler warning for newer versions of the SDL anymore.

This also enables the printing of the version number with newer versions of the SDL in the summary of the meson output again.

---
  meson.build | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
meson.build +0 -0
index bc76ea96bf..8ccd928dca 100644
@@ -1273,10 +1273,12 @@ if not get_option('sdl').auto() or have_system
    sdl_image = not_found
  endif
  if sdl.found()

meson.build if not get_option('sdl').auto() or have_system · line 1281

Quoted 10 lines
meson.build +6 -4
-  # work around 2.0.8 bug
-  sdl = declare_dependency(compile_args: '-Wno-undef',
-                           dependencies: sdl,
-                           version: sdl.version())
+  if sdl.version().version_compare('<=2.0.8')
+    # work around 2.0.8 bug
+    sdl = declare_dependency(compile_args: '-Wno-undef',
+                             dependencies: sdl,
+                             version: sdl.version())
+  endif

Drat, never mind, this still fails with the SDL2 from MinGW:

https://gitlab.com/thuth/qemu/-/jobs/4385862312#L3048

Thomas