diff mbox series

[3/4] meson: Mingw64 gcc doesn't recognize system include_type for sdl2

Message ID 20200825165341.520-3-luoyonggang@gmail.com
State New
Headers show
Series [1/4] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja | expand

Commit Message

Yonggang Luo Aug. 25, 2020, 4:53 p.m. UTC
From: Yonggang Luo <luoyonggang@gmail.com>

Fixes this for msys2/mingw64 by remove the include_type for sdl2 discovery in meson
---
 meson.build | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Mark Cave-Ayland Aug. 25, 2020, 9:38 p.m. UTC | #1
On 25/08/2020 17:53, luoyonggang@gmail.com wrote:

> From: Yonggang Luo <luoyonggang@gmail.com>
> 
> Fixes this for msys2/mingw64 by remove the include_type for sdl2 discovery in meson
> ---
>  meson.build | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index f0fe5f8799..1644bbd83c 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -224,8 +224,7 @@ if 'CONFIG_BRLAPI' in config_host
>    brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
>  endif
>  
> -sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static,
> -                 include_type: 'system')
> +sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
>  sdl_image = not_found
>  if sdl.found()
>    # work around 2.0.8 bug

This gets around the issue whereby "-isystem" paths are not escaped correctly on
Windows, presumably by changing them to "-iquote" instead.

Marc-André had a query about why this is marked as a system include, however I can
confirm that it fixes the missing "SDL.h" issue during build.


ATB,

Mark.
Paolo Bonzini Aug. 26, 2020, 6:48 a.m. UTC | #2
On Tue, Aug 25, 2020 at 11:38 PM Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
> Marc-André had a query about why this is marked as a system include, however I can
> confirm that it fixes the missing "SDL.h" issue during build.

It was marked as a system include in an attempt to work around the SDL
2.0.8 bug that requires -Wno-undef. In general we enable lots of
warnings and sometimes they trip dependencies, so using include_type:
'system' in principle makes sense. But if it doesn't work with
Windows, it's not a regression to remove it.

Paolo
Daniel P. Berrangé Aug. 26, 2020, 8:22 a.m. UTC | #3
On Wed, Aug 26, 2020 at 08:48:22AM +0200, Paolo Bonzini wrote:
> On Tue, Aug 25, 2020 at 11:38 PM Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
> > Marc-André had a query about why this is marked as a system include, however I can
> > confirm that it fixes the missing "SDL.h" issue during build.
> 
> It was marked as a system include in an attempt to work around the SDL
> 2.0.8 bug that requires -Wno-undef. In general we enable lots of
> warnings and sometimes they trip dependencies, so using include_type:
> 'system' in principle makes sense. But if it doesn't work with
> Windows, it's not a regression to remove it.

SDL code is isolated to just a couple of files, so if we nede to squelch
a -Wno-undef warning, we can just use pragma push/pop to disable the
warning selectively in the code.


Regards,
Daniel
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index f0fe5f8799..1644bbd83c 100644
--- a/meson.build
+++ b/meson.build
@@ -224,8 +224,7 @@  if 'CONFIG_BRLAPI' in config_host
   brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
 endif
 
-sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static,
-                 include_type: 'system')
+sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
 sdl_image = not_found
 if sdl.found()
   # work around 2.0.8 bug