Add a separate nativeSrcsConfigs module to handle Android Studio constraints for native code editor support.

(cherry picked from commit edf762fba6)
This commit is contained in:
Fredia Huya-Kouadio 2020-10-28 16:32:45 -07:00 committed by Rémi Verschelde
parent 3b547457d7
commit 835d4535b7
No known key found for this signature in database
GPG key ID: C3336907360768E1
9 changed files with 72 additions and 18 deletions

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.godotengine.godot" />

View file

@ -0,0 +1,19 @@
# Non functional cmake build file used to provide Android Studio editor support to the project.
cmake_minimum_required(VERSION 3.6)
project(godot)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(GODOT_ROOT_DIR ../../../..)
# Get sources
file(GLOB_RECURSE SOURCES ${GODOT_ROOT_DIR}/*.c**)
file(GLOB_RECURSE HEADERS ${GODOT_ROOT_DIR}/*.h**)
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
target_include_directories(${PROJECT_NAME}
SYSTEM PUBLIC
${GODOT_ROOT_DIR}
${GODOT_ROOT_DIR}/modules/gdnative/include)

View file

@ -0,0 +1,4 @@
## Native sources configs
This is a non functional Android library used to provide Android Studio editor support to the Godot project native files.
Nothing else should be added to this library.

View file

@ -0,0 +1,54 @@
// Non functional android library used to provide Android Studio editor support to the project.
plugins {
id 'com.android.library'
}
android {
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
}
compileOptions {
sourceCompatibility versions.javaVersion
targetCompatibility versions.javaVersion
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
// Should be uncommented for development purpose within Android Studio
// doNotStrip '**/*.so'
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
libraryVariants.all { variant ->
def buildType = variant.buildType.name.capitalize()
def taskPrefix = ""
if (project.path != ":") {
taskPrefix = project.path + ":"
}
// Disable the externalNativeBuild* task as it would cause build failures since the cmake build
// files is only setup for editing support.
gradle.startParameter.excludedTaskNames += taskPrefix + "externalNativeBuild" + buildType
}
}
dependencies {}