{"id":14585,"url":"https://patchwork.libcamera.org/api/1.1/patches/14585/?format=json","web_url":"https://patchwork.libcamera.org/patch/14585/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211112062948.1432821-1-hiroh@chromium.org>","date":"2021-11-12T06:29:48","name":"[libcamera-devel,v4] lc-compliance: Build with gtest in subprojects","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a1e51fba0d8c27891521e7f32f4e52e841f28b3a","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14585/mbox/","series":[{"id":2715,"url":"https://patchwork.libcamera.org/api/1.1/series/2715/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2715","date":"2021-11-12T06:29:48","name":"[libcamera-devel,v4] lc-compliance: Build with gtest in subprojects","version":4,"mbox":"https://patchwork.libcamera.org/series/2715/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14585/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14585/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 61261BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Nov 2021 06:29:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 783746034D;\n\tFri, 12 Nov 2021 07:29:57 +0100 (CET)","from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com\n\t[IPv6:2607:f8b0:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 68DC560232\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Nov 2021 07:29:56 +0100 (CET)","by mail-pf1-x42c.google.com with SMTP id x131so7657250pfc.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Nov 2021 22:29:56 -0800 (PST)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:e65a:906b:8c5c:e7f8])\n\tby smtp.gmail.com with ESMTPSA id\n\tcv1sm9769850pjb.48.2021.11.11.22.29.52\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 11 Nov 2021 22:29:53 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"fgokP/Hv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=F1KNCN40VbB3g8tpkQDcWaOhyB+TH2rzFO0r9HSPUjw=;\n\tb=fgokP/Hv2KQl5RuXbbaR7JandnvI0/iWivVa7aAjZPsyzZc6gopFK8xqAvTcj18OoQ\n\tL4DTAhA8xxLGfDMjdU1bUJVdabmTyhuBoPoubBV+8Uh1X2vKpcMFKM6/C8VJDbBmImfc\n\tjfM0SyTcjV8pViD8Vr9hNoaRUfxfqpvkT48pU=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=F1KNCN40VbB3g8tpkQDcWaOhyB+TH2rzFO0r9HSPUjw=;\n\tb=oBPktmz1dLIr8xwqE1s2oLpPRLZl4nFBdaGGuIw5Ow7dwtSQDelwBuxf0fwQX9rpIj\n\t6/X1LP808bz1waSB6VXeTiKidWL3CQJMQ4lwwFz0FHvNE7RcsSj1zS8VfxcDulLB/Dl9\n\t0fu6sht0WzUJrf4l48MPMyvV7T1X7ZJeqQsYgVS605rPnK20LUtpnnq3/TGMd5JTbDoK\n\tkhXJ9phr8Edg9LygVCtYzNSzbpRzmTLYsGBqP8RUnDvX3WkBGVBgWpJBabJd7Av6usct\n\tqwtIHA5Yz9OEbHhCNl+8pD47d7mAy7dsFoAZtdz4wtmaFQgCLGH0VtcSszxNqAbObgyd\n\tGUeQ==","X-Gm-Message-State":"AOAM532yI+DW4wwSLiGvWJ7mak2bPLDHoSkAGEPGmut908LA/93W9ac8\n\t24+mJKE3rtfYBfdO6miuVRKyWIsvh6J2PQ==","X-Google-Smtp-Source":"ABdhPJxflJL+cMJCOU6P8c+jmwvmx+jgBw50OZ2cDvGhVbe9HAGXev4/NnHAg7e2APa3s3hAwlJcxQ==","X-Received":"by 2002:aa7:9e9c:0:b0:49f:c7cf:ff5 with SMTP id\n\tp28-20020aa79e9c000000b0049fc7cf0ff5mr11816836pfq.62.1636698594415; \n\tThu, 11 Nov 2021 22:29:54 -0800 (PST)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 12 Nov 2021 15:29:48 +0900","Message-Id":"<20211112062948.1432821-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.34.0.rc1.387.gb447b232ab-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4] lc-compliance: Build with gtest in\n\tsubprojects","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"libgtest-dev is provided as a static library at least by Debian 10.\nThe compiler and linker to create the static library might be\ndifferent from ones used for libcamera. This causes a problem\nupon linking.\n\nThis puts gtest code to subprojects, builds the code and link it\nfor lc-compliance. However, libgtest is locally built as a library on\nChromeOS and thus the used compiler and linker are the same as one\nused for libcamera. We don't do these on ChromeOS build environment.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nTested-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n README.rst                    |  2 +-\n src/lc-compliance/meson.build | 16 ++++++++++++++--\n subprojects/.gitignore        |  4 +++-\n subprojects/gtest.wrap        | 14 ++++++++++++++\n 4 files changed, 32 insertions(+), 4 deletions(-)\n create mode 100644 subprojects/gtest.wrap\n\n--\n2.34.0.rc1.387.gb447b232ab-goog","diff":"diff --git a/README.rst b/README.rst\nindex 8af5f118..c48b4dba 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -99,7 +99,7 @@ for android: [optional]\n         libexif-dev libjpeg-dev libyaml-dev\n\n for lc-compliance: [optional]\n-        libevent-dev libgtest-dev\n+        libevent-dev\n\n Using GStreamer plugin\n ~~~~~~~~~~~~~~~~~~~~~~\ndiff --git a/src/lc-compliance/meson.build b/src/lc-compliance/meson.build\nindex aa5852f6..130ddbb5 100644\n--- a/src/lc-compliance/meson.build\n+++ b/src/lc-compliance/meson.build\n@@ -1,13 +1,25 @@\n # SPDX-License-Identifier: CC0-1.0\n\n libevent = dependency('libevent_pthreads', required : get_option('lc-compliance'))\n-libgtest = dependency('gtest', required : get_option('lc-compliance'))\n\n-if not (libevent.found() and libgtest.found())\n+if not libevent.found()\n     lc_compliance_enabled = false\n     subdir_done()\n endif\n\n+if get_option('android_platform') == 'cros'\n+    libgtest = dependency('gtest', required : get_option('lc-compliance'))\n+\n+    if not libgtest.found()\n+        lc_compliance_enabled = false\n+        subdir_done()\n+    endif\n+\n+else\n+    libgtest_sp = subproject('gtest')\n+    libgtest = libgtest_sp.get_variable('gtest_dep')\n+endif\n+\n lc_compliance_enabled = true\n\n lc_compliance_sources = files([\ndiff --git a/subprojects/.gitignore b/subprojects/.gitignore\nindex 410b8bd6..391fde2c 100644\n--- a/subprojects/.gitignore\n+++ b/subprojects/.gitignore\n@@ -1 +1,3 @@\n-/libyuv\n\\ No newline at end of file\n+/googletest-release*\n+/libyuv\n+/packagecache\n\\ No newline at end of file\ndiff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap\nnew file mode 100644\nindex 00000000..40128b35\n--- /dev/null\n+++ b/subprojects/gtest.wrap\n@@ -0,0 +1,14 @@\n+[wrap-file]\n+directory = googletest-release-1.11.0\n+source_url = https://github.com/google/googletest/archive/release-1.11.0.zip\n+source_filename = gtest-1.11.0.zip\n+source_hash = 353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a\n+patch_filename = gtest_1.11.0-1_patch.zip\n+patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.11.0-1/get_patch\n+patch_hash = d38c39184384608b08419be52aed1d0f9d9d1b5ed71c0c35e51cccbdddab7084\n+\n+[provide]\n+gtest = gtest_dep\n+gtest_main = gtest_main_dep\n+gmock = gmock_dep\n+gmock_main = gmock_main_dep\n","prefixes":["libcamera-devel","v4"]}