Re: [hatari-devel] Windows cross compile build inconsistencies with SDL2

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Fri, 2 Apr 2021 12:09:30 +0200
schrieb Jens Guenther <dbotw@xxxxxxx>:

> On Fri, 2 Apr 2021 10:48:44 +0200 Thomas Huth <th.huth@xxxxxxxxx>
> wrote:
> 
> > I've also moved the extra CFLAGS to the src folder since that's the
> > only place where we link with the SDL library, so hopefully that
> > should fix the problem with main vs. SDL_main vs. WinMain, too.  
> 
> Still fails on native MinGW-w64

What failure do you exactly get?

> - the following patch fixes the build
> here:
> 
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index 1ecbe614..51de5012 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -73,7 +73,9 @@ if(CapsImage_FOUND)
>  endif(CapsImage_FOUND)
> 
>  if(SDL2_OTHER_CFLAGS)
> -	add_definitions(${SDL2_OTHER_CFLAGS})
> +	if(NOT MINGW)
> +		add_definitions(${SDL2_OTHER_CFLAGS})
> +	endif()

Hmm, that can't be the solution either. IIRC I once added the whole
stuff with the "other cflags" to fix compilation problems on Windows...

But looking twice, I wonder whether we need this at all anymore. SDL2
is supposed to also work without the SDL_main hacks that were required
for SDL1 ... maybe we could simply drop this completely now?

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/