blupi-games / blupimania

Blupimania source code
https://www.blupi.org
Other
8 stars 1 forks source link

Does not build as non-static #8

Closed OdyX closed 9 months ago

OdyX commented 9 months ago

Hey @Skywalker13 . Yet another Epsitec game to add to Debian! :-P

I've tried to build it simply in a Debian chroot with the following commands:

# mkdir build
# cmake -B ./build -S .
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Warning (dev) at /usr/share/cmake-3.28/Modules/GNUInstallDirs.cmake:243 (message):
  Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
  target architecture is known.  Please enable at least one language before
  including GNUInstallDirs.
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for ronn to generate manpages - found
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /build/build
# cd build
# make blupimania         
[  9%] Building C object CMakeFiles/blupimania.dir/src/argtable3/argtable3.c.o
[ 18%] Building C object CMakeFiles/blupimania.dir/src/decor.c.o
[ 27%] Building C object CMakeFiles/blupimania.dir/src/icone.c.o
[ 36%] Building C object CMakeFiles/blupimania.dir/src/move.c.o
[ 45%] Building C object CMakeFiles/blupimania.dir/src/pal.c.o
[ 54%] Building C object CMakeFiles/blupimania.dir/src/play.c.o
[ 63%] Building C object CMakeFiles/blupimania.dir/src/sdl/SDL3_IMG_webp.c.o
/build/src/sdl/SDL3_IMG_webp.c:158:1: error: static declaration of 'IMG_LoadWEBPAnimation_RW' follows non-static declaration
  158 | IMG_LoadWEBPAnimation_RW (SDL_RWops * src)
      | ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /build/src/sdl/SDL3_IMG_webp.c:24:
/usr/include/SDL2/SDL_image.h:2171:41: note: previous declaration of 'IMG_LoadWEBPAnimation_RW' with type 'IMG_Animation *(SDL_RWops *)'
 2171 | extern DECLSPEC IMG_Animation * SDLCALL IMG_LoadWEBPAnimation_RW(SDL_RWops *src);
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [CMakeFiles/blupimania.dir/build.make:160: CMakeFiles/blupimania.dir/src/sdl/SDL3_IMG_webp.c.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:85: CMakeFiles/blupimania.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:92: CMakeFiles/blupimania.dir/rule] Error 2
make: *** [Makefile:169: blupimania] Error 2

As I've seen there's a SDL3_image available in Debian experimental, I have tried to drop your sdl/ SDL3_image fork and update the CMakeLists.txt dumbly:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e6eecb..51d9d19 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,6 +157,8 @@ if (NOT BUILD_JS)
     include_directories (${SDL2_IMAGE_INCLUDE_DIRS})
     find_package (SDL2_mixer REQUIRED)
     include_directories (${SDL2_MIXER_INCLUDE_DIRS})
+    find_package (SDL3 REQUIRED)
+    find_package (SDL3_image REQUIRED)
   endif ()
 endif ()

@@ -221,6 +223,7 @@ else ()
     ${SDL2_LIBRARIES}
     ${SDL2_MIXER_LIBRARIES}
     ${SDL2_IMAGE_LIBRARIES}
+    ${SDL3_IMAGE_LIBRARIES}
     ${CURL_LIBRARIES}
     ${SDLKitchensink_LIBRARIES}
     pthread

But haven't made this build yet. Any inputs?

Best, Didier

Skywalker13 commented 9 months ago

Hi Didier, Thanks

I will investigate in some days and I go back to you.

Skywalker13 commented 9 months ago

SDL3 cannot be mixed with SDL2. I just forked one SDL3_image source file because I need to support webp animations. Of course, when SDL3 will be officially stable, I upgrade everything from SDL2 to SDL3.

I will just add a namespace with the SDL3_IMG_webp.c functions in order to prevent clashes.

Skywalker13 commented 9 months ago

@OdyX I've changed the signatures, no more clash possible here. Can you try with the current master please ?