File tree 2 files changed +42
-3
lines changed
2 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ CCASFLAGS=$(CFLAGS)
35
35
STATIC_LDFLAGS =-lstdc++
36
36
STRIP ?= strip
37
37
USE_STACK_PROTECTOR = Yes
38
+ USE_LOW_VERSION_NDK =No
39
+ USE_ANT =No
38
40
39
41
SHAREDLIB_MAJORVERSION =7
40
42
FULL_VERSION := 2.3.0
@@ -80,10 +82,16 @@ endif
80
82
# Make sure the all target is the first one
81
83
all : libraries binaries
82
84
83
- ifeq ($(findstring android-ndk-r18, $(NDKROOT ) ) , android-ndk-r18)
84
- include $(SRC_PATH ) build/platform-android-r18b.mk
85
+ ifeq (android, $(OS ) )
86
+ USE_LOW_VERSION_NDK = $(shell $(SRC_PATH ) build/ndk-version-check.sh $(NDKROOT ) )
87
+ ifeq (Yes, $(USE_LOW_VERSION_NDK ) )
88
+ USE_ANT = Yes
89
+ include $(SRC_PATH ) build/platform-android-r18b.mk
85
90
else
86
- include $(SRC_PATH ) build/platform-$(OS ) .mk
91
+ include $(SRC_PATH ) build/platform-android.mk
92
+ endif
93
+ else
94
+ include $(SRC_PATH ) build/platform-$(OS ) .mk
87
95
endif
88
96
89
97
MODULE := $(LIBPREFIX )$(MODULE_NAME ) .$(SHAREDLIBSUFFIX )
@@ -368,14 +376,23 @@ endif
368
376
ifeq (android,$(OS ) )
369
377
ifeq (./,$(SRC_PATH ) )
370
378
codec_unittest$(EXEEXT ) :
379
+ ifeq ($(USE_ANT ) , Yes)
380
+ cd ./test/build/android && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
381
+ else
371
382
$(NDK_BUILD) -C test/build/android -B
372
383
./gradlew unittest:assembleDebug
384
+ endif
373
385
374
386
clean_Android : clean_Android_ut
375
387
clean_Android_ut :
388
+ ifeq ($(USE_ANT ) , Yes)
389
+ -cd ./test/build/android && $(NDKROOT)/ndk-build APP_ABI=$(APP_ABI) clean && ant clean
390
+ else
376
391
-$(NDK_BUILD) -C test/build/android -B clean
377
392
-./gradlew unittest:clean
378
393
endif
394
+
395
+ endif
379
396
endif
380
397
381
398
endif
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # **********************************************************************************
3
+ # This script is using in Makefile to check the ndk version:
4
+ #
5
+ # --usage:
6
+ # ./ndk-version-check.sh ndkroot
7
+ #
8
+ # date: 10/20/2023 Created
9
+ # **********************************************************************************
10
+
11
+ NDK_PATH=$1
12
+ if [ ! -n " $NDK_PATH " ]
13
+ then
14
+ exit 1
15
+ fi
16
+ NDK_VERSION=${NDK_PATH##*/ }
17
+ NDK_VERSION_NUM=` echo $NDK_VERSION | tr -cd " [0-9]" `
18
+
19
+ if [ $NDK_VERSION_NUM -le 18 ]
20
+ then
21
+ echo " Yes"
22
+ fi
You can’t perform that action at this time.
0 commit comments