Skip to content

Commit

Permalink
Updating readme and added jni
Browse files Browse the repository at this point in the history
  • Loading branch information
MrcSnm committed Jul 30, 2020
1 parent 3841234 commit 40fedae
Show file tree
Hide file tree
Showing 2 changed files with 395 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ After downloading it, it's time to setup your compiler to find its existence.
```
- In the line of `-gcc=` you should put your Android NDK, mine was on that folder, but what you should search for is `toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang`

After that, download the sample from the official wiki:
After that, download a sample d program from the official wiki:
```sh
curl -L -O https://raw.githubusercontent.com/dlang/dmd/master/samples/sieve.d

Expand All @@ -106,3 +106,29 @@ ldc2 -mtriple=aarch64--linux-android sieve.d
# Compile & link natively in Termux
ldc2 sieve.d
```
If it compiles well, your LDC is correctly configured to start working with Android.

# Android Project
After your first succesful try of compiling it to the Android architecture, you will actually need to do three things:
1. Compile your project as a




# SDL Project
You need to get the project from libsdl, the current SDL Version is SDL2.0.12, get the source code from [libsdl](https://www.libsdl.org/download-2.0.php)
- Click to download the SDL2-X.Y.Z.tar.gz
- Extract those files
- Import SDL2-X.Y.Z/android-project into Android Studio
- Generate symbolic links inside app/jni folder using
```sh
ln -s SDL2-X.Y.Z SDL2
ln -s SDL2_image-X.Y.Z SDL2_image
ln -s SDL2_mixer-X.Y.Z SDL2_mixer
ln -s SDL2_net-X.Y.Z SDL2_net
ln -s SDL2_ttf-X.Y.Z SDL2_ttf
```
- Go into Android Studio Build/Rebuild Project
Now your project should throw a gradlew error about `YourSourceHere.c', needed by...`, basically, this file is a placeholder for the android-project, just
go into app/jni/src/Android.mk and modify LOCAL_SRC_FILES := YourSourceHere.c to include the needed file, after that, Sync the gradle, build your project and
it should be able to run
Loading

0 comments on commit 40fedae

Please sign in to comment.