Skip to contentSkip to conversation

meson: Add missing SDL dependency to system/main.c

PATCH In review Philippe Mathieu-Daudé 2 participants 4 messages Nov 20, 2024 – Dec 3, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: Add missing SDL dependency to system/main.c

When building QEMU configure with --disable-gtk --disable-cocoa on macOS we get:

../system/main.c:30:10: fatal error: 'SDL.h' file not found

     30 | #include <SDL.h>
        |          ^~~~~~~

1 error generated.

Fix by adding the SDL dependency to main.c it's CFLAGS contains the SDL include directory.

Fixes 64ed6f92ff ("meson: link emulators without Makefile.target")

---
Looking at commit 88c39c8693 ("Simplify softmmu/main.c") I wonder if this header is still required.

---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meson.build +2 -2
index e0b880e4e1..846ffa3834 100644
@@ -4235,14 +4235,14 @@ foreach target : target_dirs
       'name': 'qemu-system-' + target_name,
       'win_subsystem': 'console',
       'sources': files('system/main.c'),
-      'dependencies': []
+      'dependencies': [sdl]
     }]
     if host_os == 'windows' and (sdl.found() or gtk.found())
       execs += [{
         'name': 'qemu-system-' + target_name + 'w',
         'win_subsystem': 'windows',
         'sources': files('system/main.c'),
-        'dependencies': []
+        'dependencies': [sdl]
       }]
     endif
     if get_option('fuzzing')
Signature · 1 line
2.45.2
#1 lore raw
Quoted 3 lines · Philippe Mathieu-Daudé

When building QEMU configure with --disable-gtk --disable-cocoa on macOS we get:

Relevant ./configure output:

User interface

    Cocoa support                   : NO
    SDL support                     : YES 2.30.5
    SDL image support               : NO
    GTK support                     : NO
    pixman                          : YES 0.42.2
    VTE support                     : NO
    PNG support                     : YES 1.6.43
    VNC support                     : YES
    VNC SASL support                : YES
    VNC JPEG support                : YES 3.0.3
    spice protocol support          : YES 0.14.4
      spice server support          : NO
    curses support                  : YES
    brlapi support                  : NO

User defined options

    cocoa                           : disabled
    docs                            : disabled
    gtk                             : disabled
Quoted 38 lines

../system/main.c:30:10: fatal error: 'SDL.h' file not found

      30 | #include <SDL.h>
         |          ^~~~~~~

1 error generated.

Fix by adding the SDL dependency to main.c it's CFLAGS contains the SDL include directory.

Fixes 64ed6f92ff ("meson: link emulators without Makefile.target")

---
Looking at commit 88c39c8693 ("Simplify softmmu/main.c") I wonder if this header is still required.

---
  meson.build | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meson.build +2 -2
index e0b880e4e1..846ffa3834 100644
@@ -4235,14 +4235,14 @@ foreach target : target_dirs
        'name': 'qemu-system-' + target_name,
        'win_subsystem': 'console',
        'sources': files('system/main.c'),
-      'dependencies': []
+      'dependencies': [sdl]
      }]
      if host_os == 'windows' and (sdl.found() or gtk.found())
        execs += [{
          'name': 'qemu-system-' + target_name + 'w',
          'win_subsystem': 'windows',
          'sources': files('system/main.c'),
-        'dependencies': []
+        'dependencies': [sdl]
        }]
      endif
      if get_option('fuzzing')
Acked-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 8 lines · Philippe Mathieu-Daudé

When building QEMU configure with --disable-gtk --disable-cocoa on macOS we get:

../system/main.c:30:10: fatal error: 'SDL.h' file not found

      30 | #include <SDL.h>
         |          ^~~~~~~

1 error generated.

Quoted 8 lines

Fix by adding the SDL dependency to main.c it's CFLAGS contains the SDL include directory.

Fixes 64ed6f92ff ("meson: link emulators without Makefile.target")

---
Looking at commit 88c39c8693 ("Simplify softmmu/main.c") I wonder if this header is still required.

I think so, SDL has its own main() wrapper. Anyhow:

Thanks,

Paolo

Quoted 25 lines
---
  meson.build | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meson.build +2 -2
index e0b880e4e1..846ffa3834 100644
@@ -4235,14 +4235,14 @@ foreach target : target_dirs
        'name': 'qemu-system-' + target_name,
        'win_subsystem': 'console',
        'sources': files('system/main.c'),
-      'dependencies': []
+      'dependencies': [sdl]
      }]
      if host_os == 'windows' and (sdl.found() or gtk.found())
        execs += [{
          'name': 'qemu-system-' + target_name + 'w',
          'win_subsystem': 'windows',
          'sources': files('system/main.c'),
-        'dependencies': []
+        'dependencies': [sdl]
        }]
      endif
      if get_option('fuzzing')
#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 11 lines · Philippe Mathieu-Daudé

When building QEMU configure with --disable-gtk --disable-cocoa on macOS we get:

../system/main.c:30:10: fatal error: 'SDL.h' file not found

      30 | #include <SDL.h>
         |          ^~~~~~~

1 error generated.

Fix by adding the SDL dependency to main.c it's CFLAGS contains the SDL include directory.

Quoted 8 lines
Fixes 64ed6f92ff ("meson: link emulators without Makefile.target")

---
Looking at commit 88c39c8693 ("Simplify softmmu/main.c") I wonder if this header is still required.

---
  meson.build | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Patch queued.