https://blog.csdn.net/u010074726/article/details/108695256
android平台交叉编译配置
https://blog.csdn.net/weixin_44413515/article/details/129069897
1)配置文件 arm64.txt:
[binaries]
c = '/etc/opt/pkg/android-ndk-r11c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang'
cpp = '/etc/opt/pkg/android-ndk-r11c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++'
ar = '/etc/opt/pkg/android-ndk-r11c/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-ar'
strip = '/etc/opt/pkg/android-ndk-r11c/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-strip'
pkgconfig = '/usr/bin/x86_64-pc-linux-gnu-pkg-config'
cmake = '/usr/local/bin/cmake/bin/cmake'
ld = '/etc/opt/pkg/android-ndk-r11c/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-ld.gold'
#pcap-config = ''
[properties]
skip_sanity_check = true
sys_root = '/etc/opt/pkg/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot'
root = '/etc/opt/pkg/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/29'
[built-in options]
c_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types']
c_link_args = ['-Wl,-O1', '-Wl,--hash-style=gnu', '-Wl,--as-needed']
cpp_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types']
cpp_link_args = ['-Wl,-O1', '-Wl,--hash-style=gnu', '-Wl,--as-needed']
#sys_root = '/etc/opt/pkg/android-ndk-r11c/toolchains/llvm/prebuilt/linux-x86_64/sysroot'
#pkg_config_libdir ='/etc/opt/pkg/android-ndk-r11c/prebuilt/linux-x86_64/lib/pkgconfig'
#pkg_config_libdir ='/etc/opt/pkg/android-ndk-r11c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/29'
[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
[target_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'armv8a'
endian = 'little'
2)解析配置
meson arm64-build --cross-file arm64.txt
3)编译
ninja -C arm64-build
meson -Dexamples=all arm64-build
0 条评论