SFML community forums

Help => General => Topic started by: OverPie on March 11, 2020, 01:41:47 pm

Title: cannot build sfml for android
Post by: OverPie on March 11, 2020, 01:41:47 pm
cannot build on ArchLinux
log:

Quote
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find GLES (missing: GLES_LIBRARY GLES_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindGLES.cmake:14 (find_package_handle_standard_args)
  cmake/Macros.cmake:364 (find_package)
  src/SFML/Window/CMakeLists.txt:263 (sfml_find_package)


-- Configuring incomplete, errors occurred!
See also "/home/unix/Projects/SFML/build/armeabi-v7a/CMakeFiles/CMakeOutput.log".

build with:
Quote
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/path/to/ndk -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang ../..

ndk ver. 21
Title: Re: cannot build sfml for android
Post by: SL4y3R on March 24, 2020, 09:47:59 am
Same here.
This problem is caused by the lack of "GLES" directory in /usr/include.
Title: Re: cannot build sfml for android
Post by: AlexAUT on March 25, 2020, 05:53:34 pm
ndk ver. 21

The ndk had some breaking changes in version 21 or 20, not sure which one. So the SDK manager does also provide an older NDK version which you can use for now, which works for SFML. It seems like they changed the paths findPackage looks for and therefore older cmake code breaks.
To fix this you could remove the findPackage call for android and just link gles directly, since it is guaranteed to be provided by the NDK anyway.

This problem is caused by the lack of "GLES" directory in /usr/include.
This path should not matter since the android toolchain should not look at your host system's header files which may/will be different to the one the actual GLES shared library was created from.
Title: Re: cannot build sfml for android
Post by: hyc3573 on January 15, 2021, 08:21:36 am
Hello. I have the same issue. Can you explain in more detail about how to change the file?