From e74894baebe0bba7a7fe37ae0a46a2e9b1b2e021 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 5 Jun 2021 17:59:12 -0400 Subject: build: Add library-based absl detection as a fallback This should help for cases where users can make abseil-cpp available but wiring up the CMake-build isn't that easy (for example, while cross-compiling). --- meson.build | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 606d40b..b4cce45 100644 --- a/meson.build +++ b/meson.build @@ -46,9 +46,47 @@ absl_dep = dependency('absl', method : 'cmake', 'absl::flags_parse', 'absl::strings', 'absl::synchronization', - ] + ], + required : false, ) +if not absl_dep.found() + warning('Could not find abseil-cpp with CMake, using fallback library detection which may fail.') + absl_libs = [ + 'absl_base', + 'absl_bad_optional_access', + 'absl_city', + 'absl_flags_commandlineflag', + 'absl_flags_commandlineflag_internal', + 'absl_flags_config', + 'absl_flags_internal', + 'absl_flags_marshalling', + 'absl_flags_parse', + 'absl_flags_private_handle_accessor', + 'absl_flags_program_name', + 'absl_flags_reflection', + 'absl_flags_usage', + 'absl_flags_usage_internal', + 'absl_hash', + 'absl_int128', + 'absl_malloc_internal', + 'absl_raw_logging_internal', + 'absl_spinlock_wait', + 'absl_stacktrace', + 'absl_str_format_internal', + 'absl_strings', + 'absl_symbolize', + 'absl_synchronization', + 'absl_throw_delegate', + 'absl_time', + 'absl_time_zone', + ] + absl_dep = [] + foreach l : absl_libs + absl_dep += cpp.find_library(l, required : false) + endforeach +endif + if ['darwin', 'ios'].contains(host_system) os_cflags = ['-DWEBRTC_MAC'] if host_system == 'ios' -- cgit v1.2.1