Skip to content

Commit 461537a

Browse files
committed
Android build fixes, incomplete.
1 parent b0b1e07 commit 461537a

File tree

7 files changed

+37
-5
lines changed

7 files changed

+37
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.dir-locals.el
22
/build/
3+
/obj/
34
/etc/b2_tests/[Zz]/
45
/dependencies/ProcessorTests/
56
*.etl

jni/Android.mk

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
LOCAL_PATH := $(call my-dir)
2+
3+
CORE_DIR := $(LOCAL_PATH)/../src
4+
5+
include $(CORE_DIR)/libretro/Makefile.common
6+
7+
COREFLAGS := -D__LIBRETRO__ -DB2_LIBRETRO_CORE -DHAVE_STRLCPY -DBUILD_TYPE_Final -DBBCMICRO_TRACE $(INCFLAGS)
8+
9+
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
10+
ifneq ($(GIT_VERSION)," unknown")
11+
COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
12+
endif
13+
14+
include $(CLEAR_VARS)
15+
LOCAL_MODULE := retro
16+
LOCAL_SRC_FILES := $(SOURCES_C) $(SOURCES_CPP)
17+
LOCAL_CXXFLAGS := $(COREFLAGS) -fexceptions -frtti -std=c++17
18+
LOCAL_CFLAGS := $(COREFLAGS)
19+
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/link.T
20+
LOCAL_LDLIBS := -llog
21+
include $(BUILD_SHARED_LIBRARY)

jni/Application.mk

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
APP_STL := c++_static
2+
APP_ABI := all

src/libretro/Makefile.common

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ SOURCES_CPP := \
3939
$(CORE_DIR)/beeb/src/TVOutput.cpp \
4040
$(CORE_DIR)/beeb/src/type.cpp \
4141
$(CORE_DIR)/beeb/src/video.cpp \
42+
$(CORE_DIR)/beeb/src/uef.cpp \
4243
$(CORE_DIR)/beeb/src/VideoULA.cpp \
4344
$(CORE_DIR)/shared/c/log.cpp \
4445
$(CORE_DIR)/shared/c/system.cpp \
@@ -52,10 +53,8 @@ SOURCES_CPP := \
5253

5354
SOURCES_C := \
5455
$(CORE_DIR)/6502/c/6502.c \
55-
$(CORE_DIR)/shared/c/path.c \
56-
5756

58-
ifneq (,$(filter osx ios-arm64 tvos-arm64,$(platform)))
57+
ifneq (,$(findstring osx,$(platform)))
5958
SOURCES_CPP += \
6059
$(CORE_DIR)/shared/c/system_osx.cpp \
6160

src/link.T

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
global: retro_*;
3+
local: *;
4+
};
5+

src/shared/c/log.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void LogStackTrace(Log *log) {
671671
if (!log) {
672672
return;
673673
}
674-
674+
#if !defined(ANDROID)
675675
void *buffer[100];
676676
int n = backtrace(buffer, sizeof buffer / sizeof buffer[0]);
677677

@@ -699,6 +699,9 @@ void LogStackTrace(Log *log) {
699699

700700
free(symbols);
701701
symbols = NULL;
702+
#else
703+
log->f("Stack trace not supported on Android");
704+
#endif
702705
}
703706

704707
//////////////////////////////////////////////////////////////////////////

src/shared/h/shared/system_posix.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ extern "C" {
1515
* system_windows.h, and it's certainly convenient. */
1616
#include <signal.h>
1717
#include <unistd.h>
18+
#if !defined(ANDROID)
1819
#include <execinfo.h>
19-
20+
#endif
2021
//////////////////////////////////////////////////////////////////////////
2122
//////////////////////////////////////////////////////////////////////////
2223

0 commit comments

Comments
 (0)