mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 03:23:45 +01:00
Fixes to Android build + option to turn LuaJIT on/off for testing purposes (#12334)
This commit is contained in:
parent
8edc0fae5f
commit
371f21fb35
@ -34,10 +34,14 @@ import android.widget.Button;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
// Native code finds these methods by name (see porting_android.cpp).
|
||||||
|
// This annotation prevents the minifier/Proguard from mangling them.
|
||||||
|
@Keep
|
||||||
public class GameActivity extends NativeActivity {
|
public class GameActivity extends NativeActivity {
|
||||||
static {
|
static {
|
||||||
System.loadLibrary("c++_shared");
|
System.loadLibrary("c++_shared");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
LOCAL_PATH := $(call my-dir)/..
|
LOCAL_PATH := $(call my-dir)/..
|
||||||
|
|
||||||
#LOCAL_ADDRESS_SANITIZER:=true
|
#LOCAL_ADDRESS_SANITIZER:=true
|
||||||
|
#USE_BUILTIN_LUA:=true
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := Curl
|
LOCAL_MODULE := Curl
|
||||||
@ -42,11 +43,15 @@ LOCAL_MODULE := Irrlicht
|
|||||||
LOCAL_SRC_FILES := deps/$(APP_ABI)/Irrlicht/libIrrlichtMt.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Irrlicht/libIrrlichtMt.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
ifndef USE_BUILTIN_LUA
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := LuaJIT
|
LOCAL_MODULE := LuaJIT
|
||||||
LOCAL_SRC_FILES := deps/$(APP_ABI)/LuaJIT/libluajit.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/LuaJIT/libluajit.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := OpenAL
|
LOCAL_MODULE := OpenAL
|
||||||
LOCAL_SRC_FILES := deps/$(APP_ABI)/OpenAL-Soft/libopenal.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/OpenAL-Soft/libopenal.a
|
||||||
@ -92,7 +97,6 @@ LOCAL_CFLAGS += \
|
|||||||
-DUSE_CURL=1 \
|
-DUSE_CURL=1 \
|
||||||
-DUSE_SOUND=1 \
|
-DUSE_SOUND=1 \
|
||||||
-DUSE_LEVELDB=0 \
|
-DUSE_LEVELDB=0 \
|
||||||
-DUSE_LUAJIT=1 \
|
|
||||||
-DUSE_GETTEXT=1 \
|
-DUSE_GETTEXT=1 \
|
||||||
-DVERSION_MAJOR=${versionMajor} \
|
-DVERSION_MAJOR=${versionMajor} \
|
||||||
-DVERSION_MINOR=${versionMinor} \
|
-DVERSION_MINOR=${versionMinor} \
|
||||||
@ -100,6 +104,12 @@ LOCAL_CFLAGS += \
|
|||||||
-DVERSION_EXTRA=${versionExtra} \
|
-DVERSION_EXTRA=${versionExtra} \
|
||||||
$(GPROF_DEF)
|
$(GPROF_DEF)
|
||||||
|
|
||||||
|
ifdef USE_BUILTIN_LUA
|
||||||
|
LOCAL_CFLAGS += -DUSE_LUAJIT=0
|
||||||
|
else
|
||||||
|
LOCAL_CFLAGS += -DUSE_LUAJIT=1
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef NDEBUG
|
ifdef NDEBUG
|
||||||
LOCAL_CFLAGS += -DNDEBUG=1
|
LOCAL_CFLAGS += -DNDEBUG=1
|
||||||
endif
|
endif
|
||||||
@ -120,12 +130,19 @@ LOCAL_C_INCLUDES := \
|
|||||||
deps/$(APP_ABI)/Irrlicht/include \
|
deps/$(APP_ABI)/Irrlicht/include \
|
||||||
deps/$(APP_ABI)/Gettext/include \
|
deps/$(APP_ABI)/Gettext/include \
|
||||||
deps/$(APP_ABI)/Iconv/include \
|
deps/$(APP_ABI)/Iconv/include \
|
||||||
deps/$(APP_ABI)/LuaJIT/include \
|
|
||||||
deps/$(APP_ABI)/OpenAL-Soft/include \
|
deps/$(APP_ABI)/OpenAL-Soft/include \
|
||||||
deps/$(APP_ABI)/SQLite/include \
|
deps/$(APP_ABI)/SQLite/include \
|
||||||
deps/$(APP_ABI)/Vorbis/include \
|
deps/$(APP_ABI)/Vorbis/include \
|
||||||
deps/$(APP_ABI)/Zstd/include
|
deps/$(APP_ABI)/Zstd/include
|
||||||
|
|
||||||
|
ifdef USE_BUILTIN_LUA
|
||||||
|
LOCAL_C_INCLUDES += \
|
||||||
|
../../lib/lua/src \
|
||||||
|
../../lib/bitop
|
||||||
|
else
|
||||||
|
LOCAL_C_INCLUDES += deps/$(APP_ABI)/LuaJIT/include
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
$(wildcard ../../src/client/*.cpp) \
|
$(wildcard ../../src/client/*.cpp) \
|
||||||
$(wildcard ../../src/client/*/*.cpp) \
|
$(wildcard ../../src/client/*/*.cpp) \
|
||||||
@ -207,6 +224,41 @@ LOCAL_SRC_FILES := \
|
|||||||
../../src/voxel.cpp \
|
../../src/voxel.cpp \
|
||||||
../../src/voxelalgorithms.cpp
|
../../src/voxelalgorithms.cpp
|
||||||
|
|
||||||
|
# Built-in Lua
|
||||||
|
ifdef USE_BUILTIN_LUA
|
||||||
|
LOCAL_SRC_FILES += \
|
||||||
|
../../lib/lua/src/lapi.c \
|
||||||
|
../../lib/lua/src/lauxlib.c \
|
||||||
|
../../lib/lua/src/lbaselib.c \
|
||||||
|
../../lib/lua/src/lcode.c \
|
||||||
|
../../lib/lua/src/ldblib.c \
|
||||||
|
../../lib/lua/src/ldebug.c \
|
||||||
|
../../lib/lua/src/ldo.c \
|
||||||
|
../../lib/lua/src/ldump.c \
|
||||||
|
../../lib/lua/src/lfunc.c \
|
||||||
|
../../lib/lua/src/lgc.c \
|
||||||
|
../../lib/lua/src/linit.c \
|
||||||
|
../../lib/lua/src/liolib.c \
|
||||||
|
../../lib/lua/src/llex.c \
|
||||||
|
../../lib/lua/src/lmathlib.c \
|
||||||
|
../../lib/lua/src/lmem.c \
|
||||||
|
../../lib/lua/src/loadlib.c \
|
||||||
|
../../lib/lua/src/lobject.c \
|
||||||
|
../../lib/lua/src/lopcodes.c \
|
||||||
|
../../lib/lua/src/loslib.c \
|
||||||
|
../../lib/lua/src/lparser.c \
|
||||||
|
../../lib/lua/src/lstate.c \
|
||||||
|
../../lib/lua/src/lstring.c \
|
||||||
|
../../lib/lua/src/lstrlib.c \
|
||||||
|
../../lib/lua/src/ltable.c \
|
||||||
|
../../lib/lua/src/ltablib.c \
|
||||||
|
../../lib/lua/src/ltm.c \
|
||||||
|
../../lib/lua/src/lundump.c \
|
||||||
|
../../lib/lua/src/lvm.c \
|
||||||
|
../../lib/lua/src/lzio.c \
|
||||||
|
../../lib/bitop/bit.c
|
||||||
|
endif
|
||||||
|
|
||||||
# GMP
|
# GMP
|
||||||
LOCAL_SRC_FILES += ../../lib/gmp/mini-gmp.c
|
LOCAL_SRC_FILES += ../../lib/gmp/mini-gmp.c
|
||||||
|
|
||||||
@ -218,12 +270,14 @@ LOCAL_STATIC_LIBRARIES += \
|
|||||||
Freetype \
|
Freetype \
|
||||||
Iconv libcharset \
|
Iconv libcharset \
|
||||||
Irrlicht \
|
Irrlicht \
|
||||||
LuaJIT \
|
|
||||||
OpenAL \
|
OpenAL \
|
||||||
Gettext \
|
Gettext \
|
||||||
SQLite3 \
|
SQLite3 \
|
||||||
Vorbis libvorbisfile libogg \
|
Vorbis libvorbisfile libogg \
|
||||||
Zstd
|
Zstd
|
||||||
|
ifndef USE_BUILTIN_LUA
|
||||||
|
LOCAL_STATIC_LIBRARIES += LuaJIT
|
||||||
|
endif
|
||||||
LOCAL_STATIC_LIBRARIES += android_native_app_glue $(PROFILER_LIBS)
|
LOCAL_STATIC_LIBRARIES += android_native_app_glue $(PROFILER_LIBS)
|
||||||
|
|
||||||
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
|
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
|
||||||
|
Loading…
Reference in New Issue
Block a user