libcamera/src/lc-compliance
Javier Martinez Canillas e526a57d09 lc-compliance: Only download gtest subproject as a fallback
Currently, a subproject is used to fetch gtest dependency unconditionally
for any Linux distribution besides ChromeOS. But it leads to a regression
in distros whose builders are not allowed to download files during build.

This change was introduced by commit 0d50a04cc9 ("lc-compliance: Build
with gtest in subprojects") and the rationale is that some distros, such
as Debian ship libgtest-dev as a static library. And this could be built
with a different toolchain than the one used to build libcamera itself.

But this seems to be a corner case, usually users will either build both
libcamera and all its dependencies using the same toolchain or build it
using both the libgtest library and toolchain as provided by the distro.

If someone doesn't want for meson to pick up the non-compatible static
library provided by the distro, then instead should make sure that their
build root does not have the package providing this installed.

Let's simplify the logic to find the dependency and just use the built-in
support in dependency() function to fallback to a subproject if not found.

This covers to common case of attempting to use the gtest provided by the
system or pulling from source if not found or is not preferred.

To force meson to fallback to the wrap for gtest you can use this command:

    meson configure -Dforce_fallback_for=gtest

and to force fallback for all the dependencies, you can use the following:

    meson build --wrap-mode=forcefallback

Fixes: commit 0d50a04cc9 ("lc-compliance: Build with gtest in subprojects")
Reported-by: Eric Curtin <ecurtin@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-02-03 18:23:48 +02:00
..
capture_test.cpp lc-compliance: Refactor using Googletest 2021-07-06 12:40:58 +02:00
environment.cpp lc-compliance: Remove using namespace in header files 2021-10-15 05:05:41 +03:00
environment.h lc-compliance: Convert to pragma once 2021-11-24 12:18:53 +00:00
main.cpp lc-compliance: Add list and filter parameters 2021-07-06 12:41:03 +02:00
meson.build lc-compliance: Only download gtest subproject as a fallback 2022-02-03 18:23:48 +02:00
simple_capture.cpp libcamera: Use simpler Signal::disconnect() function 2021-09-02 01:16:44 +03:00
simple_capture.h lc-compliance: Convert to pragma once 2021-11-24 12:18:53 +00:00