summaryrefslogtreecommitdiff
path: root/src/lc-compliance/meson.build
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-11-12 15:29:48 +0900
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-11-15 10:04:10 +0000
commit0d50a04cc918e5122d1b22201cc949c2cfd337a5 (patch)
tree32cb0b62f3314ec85f6956dce5affbce730e64d9 /src/lc-compliance/meson.build
parentd6f4abeead1e86d89dc376e8a303849bdb98d5fd (diff)
lc-compliance: Build with gtest in subprojects
libgtest-dev is provided as a static library at least by Debian 10. The compiler and linker to create the static library might be different from ones used for libcamera. This causes a problem upon linking. This puts gtest code to subprojects, builds the code and link it for lc-compliance. However, libgtest is locally built as a library on ChromeOS and thus the used compiler and linker are the same as one used for libcamera. We don't do these on ChromeOS build environment. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/lc-compliance/meson.build')
-rw-r--r--src/lc-compliance/meson.build16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lc-compliance/meson.build b/src/lc-compliance/meson.build
index aa5852f6..130ddbb5 100644
--- a/src/lc-compliance/meson.build
+++ b/src/lc-compliance/meson.build
@@ -1,13 +1,25 @@
# SPDX-License-Identifier: CC0-1.0
libevent = dependency('libevent_pthreads', required : get_option('lc-compliance'))
-libgtest = dependency('gtest', required : get_option('lc-compliance'))
-if not (libevent.found() and libgtest.found())
+if not libevent.found()
lc_compliance_enabled = false
subdir_done()
endif
+if get_option('android_platform') == 'cros'
+ libgtest = dependency('gtest', required : get_option('lc-compliance'))
+
+ if not libgtest.found()
+ lc_compliance_enabled = false
+ subdir_done()
+ endif
+
+else
+ libgtest_sp = subproject('gtest')
+ libgtest = libgtest_sp.get_variable('gtest_dep')
+endif
+
lc_compliance_enabled = true
lc_compliance_sources = files([