Android Studio cannot find my header files when they are in a different place than the main source folder of my module. This is noticeable with the #include "SDL_config.h" commands highlighted in red (other #include instructions are good).
I tried to change the values โโof cppFlags below, but I begin to doubt that these cppFlags are even passed to the compiler in general.
Has anyone been able to include files from folders other than their main source folder?
Is there a problem with the way I pointed out cppFlags or perhaps the module name or even the sources?
I could go through the SDL2 source and change all #include statements to relative #include paths, but I really don't want to change the SDL2 source. I should just list the included paths in some way.
apply plugin: 'com.android.model.application' model { ... android.ndk { moduleName = 'main' //W:\hello-sdl-android\android-project\app\src\main\jni\SDL2\include cppFlags += "-I${file("src/main/jni/SDL2/include")}".toString() cppFlags += "-I${file("src/main/jni/SDL2/src")}".toString() } android.sources { main.jni { source { srcDirs += ['src/main/jni/src'] srcDirs += ['src/main/jni/SDL2/src'] } } } ... }
UPDATE: Here is more information about my current project layout:
application / SRC / main / JNI app / src / main / jni / src / Main.cpp <- This is a compilation of app / src / main / jni / SDL2 <- All SDL2 sources are here app / src / main / jni / GLM < - Here are all GLM sources
This layout is the direct result of using the sample project I provided here: https://gitlab.com/scannerdarkly/hello-sdl-android
This project will be built using ndk-build from the command line - I wanted to take a step further by building in Android Studio. My project will try to draw a triangle on a GLES2 device.
Here is the link to my current project:
http://www.mediafire.com/download/92577p7vf123l72/hello-sdl-android.zip
source share