Skip to content

Commit 2afad83

Browse files
committed
build fix
1 parent d16f116 commit 2afad83

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

FreeImage

scripts/build-android.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
import os, shutil, errno, sys
22

3-
if os.path.exists("build"):
4-
shutil.rmtree("build")
5-
os.mkdir("build")
6-
os.chdir("build")
3+
def build(build_folder, abi):
4+
if os.path.exists(build_folder):
5+
shutil.rmtree(build_folder)
6+
os.mkdir(build_folder)
7+
os.chdir(build_folder)
78

8-
if len(sys.argv) > 1:
9-
android_ndk_path = str(sys.argv[1] + "/Data/PlaybackEngines/AndroidPlayer/NDK")
10-
print(android_ndk_path)
9+
if len(sys.argv) > 1:
10+
android_ndk_path = str(sys.argv[1] + "/Data/PlaybackEngines/AndroidPlayer/NDK")
1111

12-
cmd_configure = """cmake ../FreeImage \
13-
-G"Unix Makefiles" \
14-
-DCMAKE_BUILD_TYPE=Release \
15-
-DCMAKE_TOOLCHAIN_FILE="{android_ndk_path}/build/cmake/android.toolchain.cmake" \
16-
-DCMAKE_MAKE_PROGRAM="{android_ndk_path}/prebuilt/linux-x86_64/bin/make" \
17-
-DANDROID_NDK="{android_ndk_path}" \
18-
-DANDROID_NATIVE_API_LEVEL=android-9 \
19-
-DANDROID_ABI=arm64-v8a \
20-
-DFREEIMAGE_LIB=OFF \
21-
-DSUPPORT_FMT_TIFF=ON \
22-
-DSUPPORT_FMT_JPEG=ON""".format(android_ndk_path=android_ndk_path)
12+
cmd_configure = """cmake ../FreeImage \
13+
-G"Unix Makefiles" \
14+
-DCMAKE_BUILD_TYPE=Release \
15+
-DCMAKE_TOOLCHAIN_FILE="{android_ndk_path}/build/cmake/android.toolchain.cmake" \
16+
-DCMAKE_MAKE_PROGRAM="{android_ndk_path}/prebuilt/linux-x86_64/bin/make" \
17+
-DANDROID_NDK="{android_ndk_path}" \
18+
-DANDROID_NATIVE_API_LEVEL=android-9 \
19+
-DANDROID_ABI={abi} \
20+
-DFREEIMAGE_LIB=OFF \
21+
-DSUPPORT_FMT_TIFF=ON \
22+
-DSUPPORT_FMT_JPEG=ON""".format(android_ndk_path=android_ndk_path, abi=abi)
2323

24-
os.system(cmd_configure)
25-
os.system("cmake --build .")
24+
os.system(cmd_configure)
25+
os.system("cmake --build .")
26+
27+
build("build-arm64-v8a", "arm64-v8a")
28+
os.chdir("..")
29+
build("build-armeabi-v7a", "armeabi-v7a")

0 commit comments

Comments
 (0)