Git Product home page Git Product logo

build-sfml-for-android-on-windows's Introduction

Build SFML For Android On Windows

Batch scripts to build SFML for Android, using the latest Android NDK

Requirements

Successfully building SFML requires that you have the following in your PATH:

  • cmake (minimum version is 3.7.2)
  • git
  • the directory where MinGW is installed (for example, C:\Program Files\mingw32\bin). You can check this by trying to run mingw32-make in CMD.

How to use it

● If you have NDK installed:

Run build-sfml.bat followed by the absolute path to your NDK. For example, if your NDK is located at D:\NVPACK\android-ndk-r19, then you have to run build-sfml.bat D:\NVPACK\android-ndk-r19.

● If you don't have NDK installed:

You can install the newest version before building SFML, by executing download-ndk-and-build-sfml.bat. You can also specify where to install ndk, by providing an absolute path to the script. For example, if you want to install it in D:\Android, then you should run download-ndk-and-build-sfml.bat D:\Android. After downloading the NDK, this script will also run build-sfml.bat and thus build SFML.

Build type

By default, these scripts build SFML in Debug mode. To build it in Release mode, you have to provide --release as the last argument to either build-sfml.bat or download-ndk-and-build-sfml.bat. For example, build-sfml.bat D:\NVPACK\android-ndk-r19 --release.

Path to the downloaded SFML repository

The script will download SFML to %userprofile%\SFML. For example, if your username is Foo, you will be able to find the downloaded SFML repository at C:\Users\Foo\SFML.

Created scripts

The following scripts are created in %userprofile%\SFML\build and its subdirectories. They are also run by build-sfml.bat when it builds SFML for the first time. You can use them to rebuild SFML in case you modify something in it.

rebuild-all.bat:

Rebuilds SFML for all ABIs.

rebuild.bat (in each ABI's directory):

Rebuilds SFML for the ABI corresponding to script's directory.

build-sfml-for-android-on-windows's People

Contributors

acsbendi avatar huberti248 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

build-sfml-for-android-on-windows's Issues

Script execution failed on Windows

Hello.
I'm, trying to use your scripts to build SFML, after I lost hope with official guide.

Thank's a lot, I've build succesfully libs once, but it required to use some commands from your scripts manually. Unfortunately, next attempts to reproduce those steps were unsuccesfull.

Currently, build-sfml.bat fails with next message:
D:\SFML Build>build-sfml.bat C:\AndroidNDK\
Downloading SFML to C:\Users\nikita.smirnov\SFML
fatal: destination path 'SFML' already exists and is not an empty directory
The system cannot find the file specified.
Error occurred while processing: D:\SFML.
The system cannot find the path specified.
The system cannot find the file specified.
Error occurred while processing: D:\SFML.
The system cannot find the path specified.
Invalid number of parameters
'C:\Users\nikita.smirnov\SFML\SFML\build\rebuild-all.bat' is not recognized as an internal or external
command, operable program or batch file.
D:\SFML Build>
Don't mind with not-empy SFML, it's because I'm running the script second time. Seems problems appear when the script trying to exclude arm64 and x86_64.

I would be very grateful for any kind of help or advice.

Get error with builiding

Thank you for providing such a convenient code.
But I got in trouble with building in src\SFML\Network\Socket.cpp
get error : delegating constructors are permitted only in C++11
Socket::Socket(Socket &&rvalue) : Socket(rvalue.m_type)
and
get error : no type named 'move' in namespace 'std'
Socket tmp(std::move(rvalue));
it seems that c++ version is not fitable?
but I have already install lastest version.
Could you have ideal with this? Thanks.

System seems to be broken in several ways.

So this system seems to have rotted or never worked in most cases. For several years I've gone back to this repo to try to build SFML android on windows, hit some mystic errors, give up and retry in a few months hoping for other errors.

So first error is that rebuild.bat is not copied to the SFML download dir.

Next, fixing that the next error is that the rebuild.bat attempts to build in a directory that doesn't have a CMakeLists.txt and that's because it has ../.. in the command instead of just a single ..

So fixing that we then hit:

-- Check for working C compiler: D:/VSG/Build-SFML-For-Android-On-Windows/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "D:/VSG/Build-SFML-For-Android-On-Windows/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/micha/SFML/SFML/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:/MinGW/bin/mingw32-make.exe -f Makefile cmTC_5514b/fast && C:/MinGW/bin/mingw32-make.exe  -f CMakeFiles\cmTC_5514b.dir\build.make CMakeFiles/cmTC_5514b.dir/build
    mingw32-make.exe[1]: Entering directory 'C:/Users/micha/SFML/SFML/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_5514b.dir/testCCompiler.c.o
    D:\VSG\Build-SFML-For-Android-On-Windows\android-ndk-r20b\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi21 --gcc-toolchain=D:/VSG/Build-SFML-For-Android-On-Windows/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=D:/VSG/Build-SFML-For-Android-On-Windows/android-ndk-r20b/toolchains/llvm/prebuilt/windows-x86_64/sysroot   -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -march=armv7-a -mthumb -Wa,--noexecstack -Wformat -Werror=format-security   -fPIE -MD -MT CMakeFiles/cmTC_5514b.dir/testCCompiler.c.o -MF CMakeFiles\cmTC_5514b.dir\testCCompiler.c.o.d -o CMakeFiles\cmTC_5514b.dir\testCCompiler.c.o -c C:\Users\micha\SFML\SFML\build\CMakeFiles\CMakeTmp\testCCompiler.c
    Linking C executable cmTC_5514b
    "C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_5514b.dir\link.txt --verbose=1
    Error opening link script "CMakeFiles\cmTC_5514b.dir\link.txt"
    CMakeFiles\cmTC_5514b.dir\build.make:98: recipe for target 'cmTC_5514b' failed
    mingw32-make.exe[1]: *** [cmTC_5514b] Error 1
    mingw32-make.exe[1]: Leaving directory 'C:/Users/micha/SFML/SFML/build/CMakeFiles/CMakeTmp'
    Makefile:126: recipe for target 'cmTC_5514b/fast' failed
    mingw32-make.exe: *** [cmTC_5514b/fast] Error 2

It seems to me that the NDK is providing a compiler that simply doesn't compile correctly.

I'm largely unsure what to do from here though as I am not prepared to sink a large amount of time into simply getting SFML building for android. It'd be absolutely wonderful to have SFML Android support though. I'm not sure officially if that will happen anytime soon though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.