mirror of
https://github.com/love2d/love-android.git
synced 2026-08-12 00:20:57 +02:00
Fix log2f conflict.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
NDK_R17 := $(shell python $(call my-dir)/detect_ndkrel.py $(NDK_ROOT)/source.properties 17)
|
||||
include $(call all-subdir-makefiles)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import sys
|
||||
import re
|
||||
|
||||
def main(argv):
|
||||
if len(argv) > 1:
|
||||
# argv[0] = source.properties
|
||||
# argv[1] = desired NDK version
|
||||
f = open(argv[0], "r")
|
||||
contents = f.read()
|
||||
f.close()
|
||||
matches = re.findall("Pkg.Revision = (\d+)", contents)
|
||||
if len(matches) >= 1 and int(matches[0]) >= int(argv[1]):
|
||||
print("yes")
|
||||
else:
|
||||
print("no")
|
||||
else:
|
||||
print("unknown")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
@@ -8,11 +8,6 @@ LOCAL_CFLAGS := -DAL_ALEXT_PROTOTYPES -DAL_BUILD_LIBRARY -D_GNU_SOURCE=1 -D_P
|
||||
|
||||
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS}
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
# ARM64 have log2f function
|
||||
LOCAL_CFLAGS += -DHAVE_LOG2F
|
||||
endif
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
${LOCAL_PATH}/include \
|
||||
${LOCAL_PATH}/common \
|
||||
@@ -42,4 +37,14 @@ LOCAL_SRC_FILES := \
|
||||
|
||||
LOCAL_LDLIBS := -lOpenSLES
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
# ARM64 have log2f function
|
||||
LOCAL_CFLAGS += -DHAVE_LOG2F
|
||||
else ifeq ($(NDK_R17),yes)
|
||||
# NDK r17 and later always add log2f
|
||||
LOCAL_CFLAGS += -DHAVE_LOG2F
|
||||
# Also make sure to link with android_support
|
||||
LOCAL_LDLIBS += -landroid_support
|
||||
endif
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
Reference in New Issue
Block a user