Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: building CSFML for Android  (Read 6866 times)

0 Members and 1 Guest are viewing this topic.

ppelleti

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
building CSFML for Android
« on: October 18, 2016, 04:47:26 am »
Hi,

I've successfully built SFML for Android by following these instructions, but now I'd like to build CSFML, as well.  (Ultimately, I'd like to build the Haskell binding, but CSFML is a prerequisite for that.)

Has anyone had any success building CSFML for Android?

I followed the same procedure as for SFML, but since CSFML doesn't have a file ../../cmake/toolchains/android.toolchain.cmake, I pointed at SFML's android.toolchain.cmake.  The command line I used was:

cd CSFML && \
    mkdir build && cd build && \
    mkdir armeabi && cd armeabi && \
    cmake -DANDROID_NATIVE_API_LEVEL=android-21 -DANDROID_STL=gnustl_static -DANDROID_ABI=armeabi -DCMAKE_TOOLCHAIN_FILE=../../../SFML/cmake/toolchains/android.toolchain.cmake ../.. && \
    make && make install

This failed with:

CMake Error at cmake/Config.cmake:31 (message):
  Unsupported operating system
Call Stack (most recent call first):
  CMakeLists.txt:20 (include)

Specifically, it appears that ${CMAKE_SYSTEM_NAME} is set to Android.  I don't know a lot about CMake, but I'm puzzled that in CSFML's Config.cmake, ${CMAKE_SYSTEM_NAME} is set to Android, but in SFML's Config.cmake, Android is handled in the case where ${CMAKE_SYSTEM_NAME} is Linux.  I don't understand why this variable has different values for SFML and CSFML.

I'll work on hacking up CSFML's Config.cmake to try to get it to build, but I was just curious if I'm on the right track, and if anyone has gotten this to work before.
« Last Edit: October 22, 2016, 08:13:53 am by ppelleti »

Markle

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: building CSFML for Android
« Reply #1 on: January 06, 2017, 11:00:53 am »
I've recently started making games in C with CSFML and am hoping to do a similar thing on android soon. Did you end up getting this working?
I had a similar problem trying to build my game in Cygwin on Windows. I managed to fix it by adding it as a supported system in SFML/Config.h

:)