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

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


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 - 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()
 	# message(STATUS "Additional CFLAGS of SDL: ${SDL2_OTHER_CFLAGS}")
 endif(SDL2_OTHER_CFLAGS)

Jens



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