Skip to content

Commit

Permalink
Attempt to fix compilation error on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
anr2me committed Jul 23, 2020
1 parent 8834128 commit a39a132
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ EXEC_AND_LIB_FILES := \
$(SRC)/Core/Util/AudioFormat.cpp \
$(SRC)/Core/Util/PortManager.cpp \
$(SRC)/Core/Util/GameManager.cpp \
$(SRC)/Core/Util/PortManager.cpp \
$(SRC)/Core/Util/BlockAllocator.cpp \
$(SRC)/Core/Util/PPGeDraw.cpp \
$(SRC)/git-version.cpp
Expand Down Expand Up @@ -590,6 +591,7 @@ ifeq ($(UNITTEST),1)
include $(BUILD_EXECUTABLE)
endif

$(call import-module,miniupnpc-build)
$(call import-module,libzip)
$(call import-module,native)
$(call import-module,glslang-build)
Expand Down
45 changes: 45 additions & 0 deletions ext/miniupnpc-build/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Basic Android.mk for miniupnpc in PPSSPP

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := miniupnpc-build
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES := \
../miniupnp/miniupnpc/connecthostport.c \
../miniupnp/miniupnpc/igd_desc_parse.c \
../miniupnp/miniupnpc/minisoap.c \
../miniupnp/miniupnpc/minissdpc.c \
../miniupnp/miniupnpc/miniupnpc.c \
../miniupnp/miniupnpc/miniwget.c \
../miniupnp/miniupnpc/minixml.c \
../miniupnp/miniupnpc/minixmlvalid.c \
../miniupnp/miniupnpc/portlistingparse.c \
../miniupnp/miniupnpc/receivedata.c \
../miniupnp/miniupnpc/upnpcommands.c \
../miniupnp/miniupnpc/upnpdev.c \
../miniupnp/miniupnpc/upnperrors.c \
../miniupnp/miniupnpc/upnpreplyparse.c # \
# miniupnpcstrings.h


LOCAL_CFLAGS := -O3 -fsigned-char -fno-strict-aliasing -Wno-multichar -DNO_GETADDRINFO -DMINIUPNPC_SET_SOCKET_TIMEOUT -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -fPIC
LOCAL_CPPFLAGS := -fno-exceptions -std=gnu++11 -fno-rtti -Wno-reorder
# Note: LOCAL_PATH is the directory this file is in.
LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. $(LOCAL_PATH)/../miniupnp/miniupnpc ..

ifeq ($(findstring armeabi-v7a,$(TARGET_ARCH_ABI)),armeabi-v7a)
LOCAL_CFLAGS := $(LOCAL_CFLAGS) -DARM -DARMEABI_V7A
else ifeq ($(TARGET_ARCH_ABI),armeabi)
LOCAL_CFLAGS := $(LOCAL_CFLAGS) -DARM -DARMEABI -march=armv6
else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
LOCAL_CFLAGS := $(LOCAL_CFLAGS) -D_ARCH_64 -DARM64
else ifeq ($(TARGET_ARCH_ABI),x86)
LOCAL_CFLAGS := $(LOCAL_CFLAGS) -D_M_IX86
else ifeq ($(TARGET_ARCH_ABI),x86_64)
LOCAL_CFLAGS := $(LOCAL_CFLAGS) -D_M_X64
endif

# LOCAL_STATIC_LIBRARIES:=miniupnpc
include $(BUILD_STATIC_LIBRARY)
23 changes: 23 additions & 0 deletions ext/miniupnpc-build/miniupnpcstrings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* $Id: miniupnpcstrings.h.in,v 1.6 2014/11/04 22:31:55 nanard Exp $ */
/* Project: miniupnp
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* Author: Thomas Bernard
* Copyright (c) 2005-2014 Thomas Bernard
* This software is subjects to the conditions detailed
* in the LICENCE file provided within this distribution */
#ifndef MINIUPNPCSTRINGS_H_INCLUDED
#define MINIUPNPCSTRINGS_H_INCLUDED

#define OS_STRING "MSWindows/10.0.19041"
#define MINIUPNPC_VERSION_STRING "2.1"

#if 0
/* according to "UPnP Device Architecture 1.0" */
#define UPNP_VERSION_STRING "UPnP/1.0"
#else
/* according to "UPnP Device Architecture 1.1" */
#define UPNP_VERSION_STRING "UPnP/1.1"
#endif

#endif

0 comments on commit a39a132

Please sign in to comment.