mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-21 21:06:11 +01:00
Handle linking to liblog when [cross] building for Android using meson. (#2784)
* Alter meson for Android cross builds. * Handle liblog linking on Termux as well as the Android NDK.
This commit is contained in:
parent
08bdd43fcd
commit
c8262e1f40
@ -18,6 +18,8 @@ configure_file(
|
||||
configuration: conf_data,
|
||||
)
|
||||
|
||||
fs = import('fs')
|
||||
|
||||
benchmark_headers = [
|
||||
'benchmark/catch_benchmark.hpp',
|
||||
'benchmark/catch_benchmark_all.hpp',
|
||||
@ -340,9 +342,19 @@ foreach file : headers
|
||||
install_headers(file, subdir: join_paths(include_subdir, folder))
|
||||
endforeach
|
||||
|
||||
catch2_dependencies = []
|
||||
# Check if this is an Android NDK build.
|
||||
if ((host_machine.system() == 'android') or
|
||||
# Check if this is an Android Termux build.
|
||||
(host_machine.system() == 'linux' and fs.is_dir('/data/data/com.termux')))
|
||||
log_dep = meson.get_compiler('cpp').find_library('log')
|
||||
catch2_dependencies += log_dep
|
||||
endif
|
||||
|
||||
catch2 = static_library(
|
||||
'Catch2',
|
||||
sources,
|
||||
dependencies: catch2_dependencies,
|
||||
include_directories: '..',
|
||||
install: true,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user