Android: update toolchains, cleanup compiler flags

This commit is contained in:
MoNTE48 2020-02-03 22:56:07 +01:00
parent de8d6d1293
commit 66a865012c
5 changed files with 19 additions and 27 deletions

View File

@ -1,7 +1,7 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.3'
defaultConfig { defaultConfig {
applicationId 'com.multicraft.game' applicationId 'com.multicraft.game'
minSdkVersion 16 minSdkVersion 16

View File

@ -1,6 +1,6 @@
#Fri Dec 20 19:31:10 CET 2019 #Mon Feb 03 23:16:18 CET 2020
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-rc-1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

View File

@ -3,16 +3,13 @@ import org.ajoberstar.grgit.Grgit
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.3'
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 29 targetSdkVersion 29
externalNativeBuild { externalNativeBuild {
ndkBuild { ndkBuild {
arguments '-j', arguments '-j'
'APP_STL=c++_static',
'COMPILER_VERSION=clang',
'APP_SHORT_COMMANDS=true'
} }
} }
} }
@ -41,6 +38,8 @@ android {
} }
} }
} }
ndkVersion '21.0.6113669'
} }
task cloneGitRepo() { task cloneGitRepo() {

View File

@ -4,37 +4,37 @@ LOCAL_PATH := $(call my-dir)/..
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := Curl LOCAL_MODULE := Curl
LOCAL_SRC_FILES := deps/Android/Curl/${COMPILER_VERSION}/$(APP_ABI)/libcurl.a LOCAL_SRC_FILES := deps/Android/Curl/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libcurl.a
include $(PREBUILT_STATIC_LIBRARY) include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := Freetype LOCAL_MODULE := Freetype
LOCAL_SRC_FILES := deps/Android/Freetype/${COMPILER_VERSION}/$(APP_ABI)/libfreetype.a LOCAL_SRC_FILES := deps/Android/Freetype/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libfreetype.a
include $(PREBUILT_STATIC_LIBRARY) include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := Irrlicht LOCAL_MODULE := Irrlicht
LOCAL_SRC_FILES := deps/Android/Irrlicht/${COMPILER_VERSION}/$(APP_ABI)/libIrrlicht.a LOCAL_SRC_FILES := deps/Android/Irrlicht/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libIrrlicht.a
include $(PREBUILT_STATIC_LIBRARY) include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := LevelDB LOCAL_MODULE := LevelDB
LOCAL_SRC_FILES := deps/Android/LevelDB/${COMPILER_VERSION}/$(APP_ABI)/libleveldb.a LOCAL_SRC_FILES := deps/Android/LevelDB/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libleveldb.a
include $(PREBUILT_STATIC_LIBRARY) include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := LuaJIT LOCAL_MODULE := LuaJIT
LOCAL_SRC_FILES := deps/Android/LuaJIT/${COMPILER_VERSION}/$(APP_ABI)/libluajit.a LOCAL_SRC_FILES := deps/Android/LuaJIT/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libluajit.a
include $(PREBUILT_STATIC_LIBRARY) include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := OpenAL LOCAL_MODULE := OpenAL
LOCAL_SRC_FILES := deps/Android/OpenAL-Soft/${COMPILER_VERSION}/$(APP_ABI)/libopenal.a LOCAL_SRC_FILES := deps/Android/OpenAL-Soft/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libopenal.a
include $(PREBUILT_STATIC_LIBRARY) include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := Vorbis LOCAL_MODULE := Vorbis
LOCAL_SRC_FILES := deps/Android/Vorbis/${COMPILER_VERSION}/$(APP_ABI)/libvorbis.a LOCAL_SRC_FILES := deps/Android/Vorbis/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libvorbis.a
include $(PREBUILT_STATIC_LIBRARY) include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)

View File

@ -1,15 +1,12 @@
APP_PLATFORM := ${APP_PLATFORM} APP_PLATFORM := ${APP_PLATFORM}
APP_ABI := ${TARGET_ABI} APP_ABI := ${TARGET_ABI}
APP_STL := ${APP_STL} APP_STL := c++_static
NDK_TOOLCHAIN_VERSION := $(COMPILER_VERSION) NDK_TOOLCHAIN_VERSION := clang
APP_SHORT_COMMANDS := true
APP_MODULES := MultiCraft APP_MODULES := MultiCraft
APP_CPPFLAGS := -Ofast -fvisibility=hidden -fexceptions -Wno-deprecated-declarations -Wno-extra-tokens APP_CPPFLAGS := -Ofast -fvisibility=hidden -fexceptions -Wno-deprecated-declarations -Wno-extra-tokens
ifeq ($(COMPILER_VERSION),4.9)
APP_CPPFLAGS += -flto
endif
ifeq ($(APP_ABI),armeabi-v7a) ifeq ($(APP_ABI),armeabi-v7a)
APP_CPPFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb APP_CPPFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
endif endif
@ -22,17 +19,13 @@ ifndef NDEBUG
APP_CPPFLAGS := -g -D_DEBUG -O0 -fno-omit-frame-pointer -fexceptions APP_CPPFLAGS := -g -D_DEBUG -O0 -fno-omit-frame-pointer -fexceptions
endif endif
APP_CFLAGS := $(APP_CPPFLAGS) #-Werror=shorten-64-to-32 APP_CFLAGS := $(APP_CPPFLAGS) -Wno-parentheses-equality #-Werror=shorten-64-to-32
APP_CXXFLAGS := $(APP_CPPFLAGS) -frtti APP_CXXFLAGS := $(APP_CPPFLAGS) -std=gnu++17 -frtti
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections,--icf=safe APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections,--icf=safe
ifeq ($(COMPILER_VERSION),clang)
APP_CFLAGS += $(APP_CPPFLAGS) -Wno-parentheses-equality
APP_CXXFLAGS += $(APP_CPPFLAGS) -std=gnu++17
ifeq ($(APP_ABI),arm64-v8a) ifeq ($(APP_ABI),arm64-v8a)
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections
endif endif
endif
ifndef NDEBUG ifndef NDEBUG
APP_LDFLAGS := APP_LDFLAGS :=