Skip to content

Commit 7dda421

Browse files
meson.build: add liblog as a runtime library
Signed-off-by: DreamConnected <1487442471@qq.com>
1 parent 6eedcc5 commit 7dda421

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
-Dapparmor=true \
7474
-Dopenssl=true \
7575
-Ddbus=false \
76-
-Ddbus=false \
7776
-Dandroid-log=true \
7877
--cross-file aarch64-android-api30.txt
7978

meson.build

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,19 @@ if add_languages('cpp', required : want_oss_fuzz)
266266
add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
267267
endif
268268

269+
## Android
270+
have = cc.get_id().contains('clang') and cc.has_header('android/log.h')
271+
srcconf.set10('IS_BIONIC', have)
272+
269273
# Feature detection
274+
## Android Log System.
275+
if want_android_log
276+
liblog = cc.find_library('log', required: true)
277+
pkgconfig_libs += liblog
278+
liblxc_dependencies += liblog
279+
srcconf.set10('USE_ANDROID_LOG', liblog.found())
280+
endif
281+
270282
## I/O uring.
271283
if want_io_uring
272284
liburing = dependency('liburing')
@@ -428,7 +440,7 @@ if want_capabilities
428440
code = '''
429441
int main(int argc, char *argv[]) { return 0; };
430442
'''
431-
if libcap_static.found()
443+
if libcap_static.found() and not IS_BIONIC
432444
libcap_static_linkable = cc.links(code, args: '-static', dependencies: libcap_static)
433445
else
434446
libcap_static_linkable = false
@@ -461,15 +473,6 @@ pkgconfig_libs += pam
461473
have = cc.has_function('fmemopen', prefix: '#include <stdio.h>', args: '-D_GNU_SOURCE')
462474
srcconf.set10('HAVE_FMEMOPEN', have)
463475

464-
## Android
465-
have = cc.get_id().contains('clang') and cc.has_header('android/log.h')
466-
srcconf.set10('IS_BIONIC', have)
467-
if want_android_log
468-
liblog = cc.find_library('log')
469-
liblxc_dependencies += liblog
470-
srcconf.set10('USE_ANDROID_LOG', liblog.found())
471-
endif
472-
473476
have = cc.has_function('openpty', dependencies: libutil, prefix: '#include <pty.h>')
474477
srcconf.set10('HAVE_OPENPTY', have)
475478
if have

0 commit comments

Comments
 (0)