From 4629c36e263f2fde89e8538c28694689c90563ae Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 27 Jul 2021 19:41:46 +0930 Subject: [PATCH] [Android] Remove mk and add AndroidManifest.xml --- Android/jni/3rdParty/png/AndroidManifest.xml | 1 + Android/jni/3rdParty/png/build.gradle | 63 ++++++++++ Android/jni/3rdParty/png/png.mk | 34 ----- Android/jni/Common/AndroidManifest.xml | 1 + Android/jni/Common/CMakeLists.txt | 28 +++++ Android/jni/Common/build.gradle | 63 ++++++++++ Android/jni/Common/common.mk | 34 ----- Android/jni/Plugin-Input/AndroidManifest.xml | 1 + Android/jni/Plugin-Input/PluginInput.mk | 24 ---- Android/jni/Plugin-Input/build.gradle | 63 ++++++++++ Android/jni/Plugin-RspHle/AndroidManifest.xml | 1 + Android/jni/Plugin-RspHle/PluginRSP.mk | 32 ----- Android/jni/Plugin-RspHle/build.gradle | 63 ++++++++++ .../jni/Project64-audio/AndroidManifest.xml | 1 + .../jni/Project64-audio/Project64-audio.mk | 33 ----- Android/jni/Project64-audio/build.gradle | 63 ++++++++++ .../jni/Project64-bridge/AndroidManifest.xml | 1 + .../jni/Project64-bridge/Project64-bridge.mk | 40 ------ Android/jni/Project64-bridge/build.gradle | 59 +++++++++ .../jni/Project64-core/AndroidManifest.xml | 1 + Android/jni/Project64-core/CMakeLists.txt | 95 ++++++++++++++ Android/jni/Project64-core/Project64-core.mk | 116 ------------------ Android/jni/Project64-core/build.gradle | 63 ++++++++++ Android/jni/Settings/AndroidManifest.xml | 1 + Android/jni/Settings/Settings.mk | 18 --- Android/jni/Settings/build.gradle | 63 ++++++++++ 26 files changed, 631 insertions(+), 331 deletions(-) create mode 100644 Android/jni/3rdParty/png/AndroidManifest.xml create mode 100644 Android/jni/3rdParty/png/build.gradle delete mode 100644 Android/jni/3rdParty/png/png.mk create mode 100644 Android/jni/Common/AndroidManifest.xml create mode 100644 Android/jni/Common/CMakeLists.txt create mode 100644 Android/jni/Common/build.gradle delete mode 100644 Android/jni/Common/common.mk create mode 100644 Android/jni/Plugin-Input/AndroidManifest.xml delete mode 100644 Android/jni/Plugin-Input/PluginInput.mk create mode 100644 Android/jni/Plugin-Input/build.gradle create mode 100644 Android/jni/Plugin-RspHle/AndroidManifest.xml delete mode 100644 Android/jni/Plugin-RspHle/PluginRSP.mk create mode 100644 Android/jni/Plugin-RspHle/build.gradle create mode 100644 Android/jni/Project64-audio/AndroidManifest.xml delete mode 100644 Android/jni/Project64-audio/Project64-audio.mk create mode 100644 Android/jni/Project64-audio/build.gradle create mode 100644 Android/jni/Project64-bridge/AndroidManifest.xml delete mode 100644 Android/jni/Project64-bridge/Project64-bridge.mk create mode 100644 Android/jni/Project64-bridge/build.gradle create mode 100644 Android/jni/Project64-core/AndroidManifest.xml create mode 100644 Android/jni/Project64-core/CMakeLists.txt delete mode 100644 Android/jni/Project64-core/Project64-core.mk create mode 100644 Android/jni/Project64-core/build.gradle create mode 100644 Android/jni/Settings/AndroidManifest.xml delete mode 100644 Android/jni/Settings/Settings.mk create mode 100644 Android/jni/Settings/build.gradle diff --git a/Android/jni/3rdParty/png/AndroidManifest.xml b/Android/jni/3rdParty/png/AndroidManifest.xml new file mode 100644 index 000000000..794a0baea --- /dev/null +++ b/Android/jni/3rdParty/png/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/3rdParty/png/build.gradle b/Android/jni/3rdParty/png/build.gradle new file mode 100644 index 000000000..729d6173e --- /dev/null +++ b/Android/jni/3rdParty/png/build.gradle @@ -0,0 +1,63 @@ +apply plugin: 'com.android.library' +apply from: '../../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + diff --git a/Android/jni/3rdParty/png/png.mk b/Android/jni/3rdParty/png/png.mk deleted file mode 100644 index bcc3f1938..000000000 --- a/Android/jni/3rdParty/png/png.mk +++ /dev/null @@ -1,34 +0,0 @@ -######################### -# png -######################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./3rdParty/png - -LOCAL_MODULE := png - -LOCAL_C_INCLUDES := \ - ./jni/3rdParty/ \ - -LOCAL_SRC_FILES := \ - $(SRCDIR)/png.c \ - $(SRCDIR)/pngerror.c \ - $(SRCDIR)/pngget.c \ - $(SRCDIR)/pngmem.c \ - $(SRCDIR)/pngpread.c \ - $(SRCDIR)/pngread.c \ - $(SRCDIR)/pngrio.c \ - $(SRCDIR)/pngrtran.c \ - $(SRCDIR)/pngrutil.c \ - $(SRCDIR)/pngset.c \ - $(SRCDIR)/pngtest.c \ - $(SRCDIR)/pngtrans.c \ - $(SRCDIR)/pngwio.c \ - $(SRCDIR)/pngwrite.c \ - $(SRCDIR)/pngwtran.c \ - $(SRCDIR)/pngwutil.c \ - -LOCAL_CFLAGS := $(COMMON_CFLAGS) -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/Android/jni/Common/AndroidManifest.xml b/Android/jni/Common/AndroidManifest.xml new file mode 100644 index 000000000..1502b6e0b --- /dev/null +++ b/Android/jni/Common/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/Common/CMakeLists.txt b/Android/jni/Common/CMakeLists.txt new file mode 100644 index 000000000..689e9b867 --- /dev/null +++ b/Android/jni/Common/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 2.8) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_C_STANDARD 99) + +project("Common") + +add_library(Common STATIC + CriticalSection.cpp + DateTime.cpp + DynamicLibrary.cpp + File.cpp + HighResTimeStamp.cpp + IniFile.cpp + Log.cpp + md5.cpp + MemoryManagement.cpp + path.cpp + Platform.cpp + Random.cpp + StdString.cpp + SyncEvent.cpp + Thread.cpp + Trace.cpp + Util.cpp) + +add_definitions(-DANDROID) + +target_link_libraries(Common) diff --git a/Android/jni/Common/build.gradle b/Android/jni/Common/build.gradle new file mode 100644 index 000000000..38dab2657 --- /dev/null +++ b/Android/jni/Common/build.gradle @@ -0,0 +1,63 @@ +apply plugin: 'com.android.library' +apply from: '../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + diff --git a/Android/jni/Common/common.mk b/Android/jni/Common/common.mk deleted file mode 100644 index ef9424e6e..000000000 --- a/Android/jni/Common/common.mk +++ /dev/null @@ -1,34 +0,0 @@ -######################### -# common -######################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./Common - -LOCAL_MODULE := common - -LOCAL_C_INCLUDES := ../ \ - $(SDL_INCLUDES) \ - -LOCAL_SRC_FILES := \ - $(SRCDIR)/CriticalSection.cpp \ - $(SRCDIR)/DateTimeClass.cpp \ - $(SRCDIR)/FileClass.cpp \ - $(SRCDIR)/HighResTimeStamp.cpp \ - $(SRCDIR)/IniFileClass.cpp \ - $(SRCDIR)/LogClass.cpp \ - $(SRCDIR)/md5.cpp \ - $(SRCDIR)/MemoryManagement.cpp \ - $(SRCDIR)/path.cpp \ - $(SRCDIR)/Platform.cpp \ - $(SRCDIR)/Random.cpp \ - $(SRCDIR)/StdString.cpp \ - $(SRCDIR)/SyncEvent.cpp \ - $(SRCDIR)/Thread.cpp \ - $(SRCDIR)/Trace.cpp \ - $(SRCDIR)/Util.cpp \ - -LOCAL_CFLAGS := $(COMMON_CFLAGS) -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) diff --git a/Android/jni/Plugin-Input/AndroidManifest.xml b/Android/jni/Plugin-Input/AndroidManifest.xml new file mode 100644 index 000000000..d98037011 --- /dev/null +++ b/Android/jni/Plugin-Input/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/Plugin-Input/PluginInput.mk b/Android/jni/Plugin-Input/PluginInput.mk deleted file mode 100644 index af0615528..000000000 --- a/Android/jni/Plugin-Input/PluginInput.mk +++ /dev/null @@ -1,24 +0,0 @@ -###################### -# Project64-input-android -###################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./PluginInput - -LOCAL_MODULE := Project64-input-android -LOCAL_ARM_MODE := arm - -LOCAL_C_INCLUDES := - -LOCAL_SRC_FILES := \ - $(SRCDIR)/Main.cpp \ - -LOCAL_CFLAGS := $(COMMON_CFLAGS) - -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) \ - -D__STDC_LIMIT_MACROS \ - -LOCAL_LDLIBS := \ - -llog \ - -include $(BUILD_SHARED_LIBRARY) diff --git a/Android/jni/Plugin-Input/build.gradle b/Android/jni/Plugin-Input/build.gradle new file mode 100644 index 000000000..38dab2657 --- /dev/null +++ b/Android/jni/Plugin-Input/build.gradle @@ -0,0 +1,63 @@ +apply plugin: 'com.android.library' +apply from: '../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + diff --git a/Android/jni/Plugin-RspHle/AndroidManifest.xml b/Android/jni/Plugin-RspHle/AndroidManifest.xml new file mode 100644 index 000000000..5b9e51cce --- /dev/null +++ b/Android/jni/Plugin-RspHle/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/Plugin-RspHle/PluginRSP.mk b/Android/jni/Plugin-RspHle/PluginRSP.mk deleted file mode 100644 index 4fb84f762..000000000 --- a/Android/jni/Plugin-RspHle/PluginRSP.mk +++ /dev/null @@ -1,32 +0,0 @@ -###################### -# Project64-rsp-hle -###################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./PluginRSP - -LOCAL_MODULE := Project64-rsp-hle -LOCAL_ARM_MODE := arm - -LOCAL_C_INCLUDES := - -LOCAL_SRC_FILES := \ - $(SRCDIR)/alist.cpp \ - $(SRCDIR)/alist_audio.cpp \ - $(SRCDIR)/alist_naudio.cpp \ - $(SRCDIR)/alist_nead.cpp \ - $(SRCDIR)/audio.cpp \ - $(SRCDIR)/cicx105.cpp \ - $(SRCDIR)/hle.cpp \ - $(SRCDIR)/jpeg.cpp \ - $(SRCDIR)/main.cpp \ - $(SRCDIR)/mem.cpp \ - $(SRCDIR)/mp3.cpp \ - $(SRCDIR)/musyx.cpp \ - -LOCAL_CFLAGS := $(COMMON_CFLAGS) - -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) \ - -D__STDC_LIMIT_MACROS \ - -include $(BUILD_SHARED_LIBRARY) diff --git a/Android/jni/Plugin-RspHle/build.gradle b/Android/jni/Plugin-RspHle/build.gradle new file mode 100644 index 000000000..38dab2657 --- /dev/null +++ b/Android/jni/Plugin-RspHle/build.gradle @@ -0,0 +1,63 @@ +apply plugin: 'com.android.library' +apply from: '../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + diff --git a/Android/jni/Project64-audio/AndroidManifest.xml b/Android/jni/Project64-audio/AndroidManifest.xml new file mode 100644 index 000000000..7fa7df561 --- /dev/null +++ b/Android/jni/Project64-audio/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/Project64-audio/Project64-audio.mk b/Android/jni/Project64-audio/Project64-audio.mk deleted file mode 100644 index 612b817e3..000000000 --- a/Android/jni/Project64-audio/Project64-audio.mk +++ /dev/null @@ -1,33 +0,0 @@ -###################### -# Project64-audio-android -###################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./Project64-audio - -LOCAL_MODULE := Project64-audio-android -LOCAL_STATIC_LIBRARIES := common \ - Settings \ - -LOCAL_ARM_MODE := arm - -LOCAL_C_INCLUDES := - -LOCAL_SRC_FILES := \ - $(SRCDIR)/Driver/OpenSLES.cpp \ - $(SRCDIR)/Driver/SoundBase.cpp \ - $(SRCDIR)/AudioMain.cpp \ - $(SRCDIR)/AudioSettings.cpp \ - $(SRCDIR)/trace.cpp \ - -LOCAL_CFLAGS := $(COMMON_CFLAGS) - -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) \ - -D__STDC_LIMIT_MACROS \ - -LOCAL_LDLIBS := \ - -llog \ - -lOpenSLES \ - -latomic \ - -include $(BUILD_SHARED_LIBRARY) diff --git a/Android/jni/Project64-audio/build.gradle b/Android/jni/Project64-audio/build.gradle new file mode 100644 index 000000000..38dab2657 --- /dev/null +++ b/Android/jni/Project64-audio/build.gradle @@ -0,0 +1,63 @@ +apply plugin: 'com.android.library' +apply from: '../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + diff --git a/Android/jni/Project64-bridge/AndroidManifest.xml b/Android/jni/Project64-bridge/AndroidManifest.xml new file mode 100644 index 000000000..f3e00f577 --- /dev/null +++ b/Android/jni/Project64-bridge/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/Project64-bridge/Project64-bridge.mk b/Android/jni/Project64-bridge/Project64-bridge.mk deleted file mode 100644 index bacc12e6a..000000000 --- a/Android/jni/Project64-bridge/Project64-bridge.mk +++ /dev/null @@ -1,40 +0,0 @@ -###################### -# Project64-bridge -###################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./Project64-bridge - -LOCAL_MODULE := Project64-bridge -LOCAL_STATIC_LIBRARIES := common \ - Project64-core \ - -LOCAL_C_INCLUDES := - -LOCAL_SRC_FILES := \ - $(SRCDIR)/JavaBridge.cpp \ - $(SRCDIR)/JavaRomList.cpp \ - $(SRCDIR)/jniBridge.cpp \ - $(SRCDIR)/jniBridgeSettings.cpp \ - $(SRCDIR)/NotificationClass.cpp \ - $(SRCDIR)/SyncBridge.cpp \ - $(SRCDIR)/UISettings.cpp \ - -LOCAL_CFLAGS := \ - $(COMMON_CFLAGS) \ - -DUSE_GLES \ - -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) - -LOCAL_LDLIBS := \ - -llog \ - -latomic \ - -ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) - # Use for ARM7a: - LOCAL_CFLAGS += -mfloat-abi=softfp - LOCAL_CFLAGS += -mfpu=vfp - -endif - -include $(BUILD_SHARED_LIBRARY) diff --git a/Android/jni/Project64-bridge/build.gradle b/Android/jni/Project64-bridge/build.gradle new file mode 100644 index 000000000..d2f846f4a --- /dev/null +++ b/Android/jni/Project64-bridge/build.gradle @@ -0,0 +1,59 @@ +apply plugin: 'com.android.library' +apply from: '../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + diff --git a/Android/jni/Project64-core/AndroidManifest.xml b/Android/jni/Project64-core/AndroidManifest.xml new file mode 100644 index 000000000..d4e3c3fa5 --- /dev/null +++ b/Android/jni/Project64-core/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/Project64-core/CMakeLists.txt b/Android/jni/Project64-core/CMakeLists.txt new file mode 100644 index 000000000..43ee2831c --- /dev/null +++ b/Android/jni/Project64-core/CMakeLists.txt @@ -0,0 +1,95 @@ +cmake_minimum_required(VERSION 2.8) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_C_STANDARD 99) + +project("Project64-core") + +add_library(Project64-core STATIC + AppInit.cpp + logging.cpp + Settings.cpp + MemoryExceptionFilter.cpp + Multilanguage/Language.cpp + Settings/LoggingSettings.cpp + Settings/RecompilerSettings.cpp + N64System/Enhancement/Enhancement.cpp + N64System/Enhancement/Enhancements.cpp + N64System/Enhancement/EnhancementFile.cpp + N64System/Enhancement/EnhancementList.cpp + N64System/Interpreter/InterpreterCPU.cpp + N64System/Interpreter/InterpreterOps.cpp + N64System/Interpreter/InterpreterOps32.cpp + N64System/Mips/Audio.cpp + N64System/Mips/Dma.cpp + N64System/Mips/Disk.cpp + N64System/Mips/Eeprom.cpp + N64System/Mips/FlashRam.cpp + N64System/Mips/GBCart.cpp + N64System/Mips/MemoryVirtualMem.cpp + N64System/Mips/Mempak.cpp + N64System/Mips/OpcodeName.cpp + N64System/Mips/PifRam.cpp + N64System/Mips/Register.cpp + N64System/Mips/Rumblepak.cpp + N64System/Mips/Transferpak.cpp + N64System/Mips/Sram.cpp + N64System/Mips/SystemEvents.cpp + N64System/Mips/SystemTiming.cpp + N64System/Mips/TLB.cpp + N64System/Recompiler/CodeBlock.cpp + N64System/Recompiler/CodeSection.cpp + N64System/Recompiler/SectionInfo.cpp + N64System/Recompiler/FunctionInfo.cpp + N64System/Recompiler/FunctionMap.cpp + N64System/Recompiler/LoopAnalysis.cpp + N64System/Recompiler/Recompiler.cpp + N64System/Recompiler/RecompilerCodeLog.cpp + N64System/Recompiler/RecompilerMemory.cpp + N64System/Recompiler/RegBase.cpp + N64System/Recompiler/Aarch64/Aarch64RegInfo.cpp + N64System/Recompiler/Arm/ArmOps.cpp + N64System/Recompiler/Arm/ArmRecompilerOps.cpp + N64System/Recompiler/Arm/ArmRegInfo.cpp + N64System/Recompiler/x86/x86ops.cpp + N64System/Recompiler/x86/x86RecompilerOps.cpp + N64System/Recompiler/x86/x86RegInfo.cpp + N64System/FramePerSecond.cpp + N64System/N64System.cpp + N64System/N64Rom.cpp + N64System/Profiling.cpp + N64System/SpeedLimiter.cpp + N64System/SystemGlobals.cpp + N64System/EmulationThread.cpp + N64System/N64Disk.cpp + Plugins/AudioPlugin.cpp + Plugins/GFXplugin.cpp + Plugins/ControllerPlugin.cpp + Plugins/RSPPlugin.cpp + Plugins/PluginBase.cpp + Plugins/Plugin.cpp + RomList/RomList.cpp + Settings/SettingType/SettingsType-Application.cpp + Settings/SettingType/SettingsType-ApplicationIndex.cpp + Settings/SettingType/SettingsType-ApplicationPath.cpp + Settings/SettingType/SettingsType-GameSetting.cpp + Settings/SettingType/SettingsType-GameSettingIndex.cpp + Settings/SettingType/SettingsType-RelativePath.cpp + Settings/SettingType/SettingsType-RDBCpuType.cpp + Settings/SettingType/SettingsType-RDBOnOff.cpp + Settings/SettingType/SettingsType-RDBRamSize.cpp + Settings/SettingType/SettingsType-RDBSaveChip.cpp + Settings/SettingType/SettingsType-RDBYesNo.cpp + Settings/SettingType/SettingsType-RomDatabase.cpp + Settings/SettingType/SettingsType-RomDatabaseIndex.cpp + Settings/SettingType/SettingsType-RomDatabaseSetting.cpp + Settings/SettingType/SettingsType-SelectedDirectory.cpp + Settings/SettingType/SettingsType-TempBool.cpp + Settings/SettingType/SettingsType-TempNumber.cpp + Settings/SettingType/SettingsType-TempString.cpp + Settings/DebugSettings.cpp + Settings/GameSettings.cpp + Settings/N64SystemSettings.cpp) + +add_definitions(-DANDROID) + +target_link_libraries(Project64-core) diff --git a/Android/jni/Project64-core/Project64-core.mk b/Android/jni/Project64-core/Project64-core.mk deleted file mode 100644 index 98c3dade8..000000000 --- a/Android/jni/Project64-core/Project64-core.mk +++ /dev/null @@ -1,116 +0,0 @@ -######################### -# project64-core -######################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./Project64-core - -LOCAL_MODULE := Project64-core -LOCAL_ARM_MODE := arm -LOCAL_STATIC_LIBRARIES := common \ - zlib \ - -LOCAL_C_INCLUDES := ../ \ - ../3rdParty/ \ - - -LOCAL_SRC_FILES := \ - $(SRCDIR)/AppInit.cpp \ - $(SRCDIR)/logging.cpp \ - $(SRCDIR)/Settings.cpp \ - $(SRCDIR)/MemoryExceptionFilter.cpp \ - $(SRCDIR)/Multilanguage/LanguageClass.cpp \ - $(SRCDIR)/Settings/LoggingSettings.cpp \ - $(SRCDIR)/Settings/RecompilerSettings.cpp \ - $(SRCDIR)/N64System/Interpreter/InterpreterCPU.cpp \ - $(SRCDIR)/N64System/Interpreter/InterpreterOps.cpp \ - $(SRCDIR)/N64System/Interpreter/InterpreterOps32.cpp \ - $(SRCDIR)/N64System/Mips/Audio.cpp \ - $(SRCDIR)/N64System/Mips/Dma.cpp \ - $(SRCDIR)/N64System/Mips/Disk.cpp \ - $(SRCDIR)/N64System/Mips/Eeprom.cpp \ - $(SRCDIR)/N64System/Mips/FlashRam.cpp \ - $(SRCDIR)/N64System/Mips/GBCart.cpp \ - $(SRCDIR)/N64System/Mips/MemoryVirtualMem.cpp \ - $(SRCDIR)/N64System/Mips/Mempak.cpp \ - $(SRCDIR)/N64System/Mips/OpcodeName.cpp \ - $(SRCDIR)/N64System/Mips/PifRam.cpp \ - $(SRCDIR)/N64System/Mips/RegisterClass.cpp \ - $(SRCDIR)/N64System/Mips/Rumblepak.cpp \ - $(SRCDIR)/N64System/Mips/Transferpak.cpp \ - $(SRCDIR)/N64System/Mips/Sram.cpp \ - $(SRCDIR)/N64System/Mips/SystemEvents.cpp \ - $(SRCDIR)/N64System/Mips/SystemTiming.cpp \ - $(SRCDIR)/N64System/Mips/TLBclass.cpp \ - $(SRCDIR)/N64System/Recompiler/CodeBlock.cpp \ - $(SRCDIR)/N64System/Recompiler/CodeSection.cpp \ - $(SRCDIR)/N64System/Recompiler/SectionInfo.cpp \ - $(SRCDIR)/N64System/Recompiler/FunctionInfo.cpp \ - $(SRCDIR)/N64System/Recompiler/FunctionMapClass.cpp \ - $(SRCDIR)/N64System/Recompiler/LoopAnalysis.cpp \ - $(SRCDIR)/N64System/Recompiler/RecompilerClass.cpp \ - $(SRCDIR)/N64System/Recompiler/RecompilerCodeLog.cpp \ - $(SRCDIR)/N64System/Recompiler/RecompilerMemory.cpp \ - $(SRCDIR)/N64System/Recompiler/RegBase.cpp \ - $(SRCDIR)/N64System/Recompiler/Arm/ArmOps.cpp \ - $(SRCDIR)/N64System/Recompiler/Arm/ArmRecompilerOps.cpp \ - $(SRCDIR)/N64System/Recompiler/Arm/ArmRegInfo.cpp \ - $(SRCDIR)/N64System/Recompiler/x86/x86ops.cpp \ - $(SRCDIR)/N64System/Recompiler/x86/x86RecompilerOps.cpp \ - $(SRCDIR)/N64System/Recompiler/x86/x86RegInfo.cpp \ - $(SRCDIR)/N64System/CheatClass.cpp \ - $(SRCDIR)/N64System/FramePerSecondClass.cpp \ - $(SRCDIR)/N64System/N64Class.cpp \ - $(SRCDIR)/N64System/N64RomClass.cpp \ - $(SRCDIR)/N64System/ProfilingClass.cpp \ - $(SRCDIR)/N64System/SpeedLimiterClass.cpp \ - $(SRCDIR)/N64System/SystemGlobals.cpp \ - $(SRCDIR)/N64System/EmulationThread.cpp \ - $(SRCDIR)/N64System/N64DiskClass.cpp \ - $(SRCDIR)/Plugins/AudioPlugin.cpp \ - $(SRCDIR)/Plugins/GFXplugin.cpp \ - $(SRCDIR)/Plugins/ControllerPlugin.cpp \ - $(SRCDIR)/Plugins/RSPPlugin.cpp \ - $(SRCDIR)/Plugins/PluginBase.cpp \ - $(SRCDIR)/Plugins/PluginClass.cpp \ - $(SRCDIR)/RomList/RomList.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-Application.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-ApplicationIndex.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-ApplicationPath.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-Cheats.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-Enhancements.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-GameSetting.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-GameSettingIndex.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RelativePath.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RDBCpuType.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RDBOnOff.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RDBRamSize.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RDBSaveChip.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RDBYesNo.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RomDatabase.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RomDatabaseIndex.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-RomDatabaseSetting.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-SelectedDirectory.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-TempBool.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-TempNumber.cpp \ - $(SRCDIR)/Settings/SettingType/SettingsType-TempString.cpp \ - $(SRCDIR)/Settings/DebugSettings.cpp \ - $(SRCDIR)/Settings/GameSettings.cpp \ - $(SRCDIR)/Settings/N64SystemSettings.cpp \ - -LOCAL_CFLAGS := $(COMMON_CFLAGS) -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) - -ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) - # Use for ARM7a: - LOCAL_SRC_FILES += $(SRCDIR)/N64System/Recompiler/Arm/asm_functions.S - LOCAL_CFLAGS += -mfloat-abi=softfp - LOCAL_CFLAGS += -mfpu=vfp - -else ifeq ($(TARGET_ARCH_ABI), armeabi) - # Use for ARM7a: - LOCAL_SRC_FILES += $(SRCDIR)/N64System/Recompiler/Arm/asm_functions.S - -endif - -include $(BUILD_STATIC_LIBRARY) diff --git a/Android/jni/Project64-core/build.gradle b/Android/jni/Project64-core/build.gradle new file mode 100644 index 000000000..38dab2657 --- /dev/null +++ b/Android/jni/Project64-core/build.gradle @@ -0,0 +1,63 @@ +apply plugin: 'com.android.library' +apply from: '../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + diff --git a/Android/jni/Settings/AndroidManifest.xml b/Android/jni/Settings/AndroidManifest.xml new file mode 100644 index 000000000..ef8ab1c61 --- /dev/null +++ b/Android/jni/Settings/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/Android/jni/Settings/Settings.mk b/Android/jni/Settings/Settings.mk deleted file mode 100644 index 5834d0c5a..000000000 --- a/Android/jni/Settings/Settings.mk +++ /dev/null @@ -1,18 +0,0 @@ -######################### -# Settings -######################### -include $(CLEAR_VARS) -LOCAL_PATH := $(JNI_LOCAL_PATH) -SRCDIR := ./Settings - -LOCAL_MODULE := Settings - -LOCAL_C_INCLUDES := ../ \ - -LOCAL_SRC_FILES := \ - $(SRCDIR)/Settings.cpp \ - -LOCAL_CFLAGS := $(COMMON_CFLAGS) -LOCAL_CPPFLAGS := $(COMMON_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/Android/jni/Settings/build.gradle b/Android/jni/Settings/build.gradle new file mode 100644 index 000000000..38dab2657 --- /dev/null +++ b/Android/jni/Settings/build.gradle @@ -0,0 +1,63 @@ +apply plugin: 'com.android.library' +apply from: '../../config/version.gradle' + +android { + + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + debug { + minifyEnabled true + jniDebuggable true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + ndk { + debugSymbolLevel 'FULL' + } + } + } + + externalNativeBuild { + cmake { + version "3.10.2" + path "CMakeLists.txt" + } + } + + defaultConfig { + externalNativeBuild { + cmake { + arguments "-DANDROID=1", "-DCMAKE_BUILD_TYPE=Release", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang" + cppFlags "-fexceptions", "-ffast-math", "-ftree-vectorize" + cFlags "-ffast-math", "-ftree-vectorize" + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + } + } + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + packagingOptions { + exclude 'lib/x86/libc++_shared.so' + exclude 'lib/x86_64/libc++_shared.so' + exclude 'lib/armeabi-v7a/libc++_shared.so' + exclude 'lib/arm64-v8a/libc++_shared.so' + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +} +