Skip to content

Commit

Permalink
Handle linking to liblog when [cross] building for Android using meso…
Browse files Browse the repository at this point in the history
…n. (#2784)

* Alter meson for Android cross builds.

* Handle liblog linking on Termux as well as the Android NDK.
  • Loading branch information
Kagetsuki authored Dec 28, 2023
1 parent 08bdd43 commit c8262e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/catch2/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ configure_file(
configuration: conf_data,
)

fs = import('fs')

benchmark_headers = [
'benchmark/catch_benchmark.hpp',
'benchmark/catch_benchmark_all.hpp',
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit c8262e1

Please sign in to comment.