diff options
| author | 影月 零 | 2023-12-29 07:40:42 +0900 |
|---|---|---|
| committer | GitHub | 2023-12-28 23:40:42 +0100 |
| commit | c8262e1f40c8308a47ff22ad92286f4c3c54425d (patch) | |
| tree | d9070615573f9b5e5cb0b424873225a745952431 | |
| parent | 08bdd43fcd8987c922c26a32e690bffc78d3c463 (diff) | |
| download | catch3-c8262e1f40c8308a47ff22ad92286f4c3c54425d.tar.gz | |
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.
| -rw-r--r-- | src/catch2/meson.build | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/catch2/meson.build b/src/catch2/meson.build index 4b9f3e8e..cc45e641 100644 --- a/src/catch2/meson.build +++ b/src/catch2/meson.build @@ -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, ) |