{"id":14468,"url":"https://patchwork.libcamera.org/api/1.1/patches/14468/?format=json","web_url":"https://patchwork.libcamera.org/patch/14468/","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":"<20211108060135.370781-1-hiroh@chromium.org>","date":"2021-11-08T06:01:35","name":"[libcamera-devel] lc-compliance: Build with googltest in subproject","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"fd85603ce1179f0b7793fb9a3d82a072f20303a6","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/14468/mbox/","series":[{"id":2695,"url":"https://patchwork.libcamera.org/api/1.1/series/2695/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2695","date":"2021-11-08T06:01:35","name":"[libcamera-devel] lc-compliance: Build with googltest in subproject","version":1,"mbox":"https://patchwork.libcamera.org/series/2695/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14468/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14468/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 43FDEBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Nov 2021 06:01:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 768426034F;\n\tMon,  8 Nov 2021 07:01:47 +0100 (CET)","from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com\n\t[IPv6:2607:f8b0:4864:20::42a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 80D5260234\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Nov 2021 07:01:45 +0100 (CET)","by mail-pf1-x42a.google.com with SMTP id c126so6514216pfb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 07 Nov 2021 22:01:45 -0800 (PST)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:c3da:4e21:7720:afe7])\n\tby smtp.gmail.com with ESMTPSA id\n\tj15sm14379654pfh.35.2021.11.07.22.01.41\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 07 Nov 2021 22:01:43 -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=\"KfK7r0F9\"; 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=0w6ecWqyvcQ2TYthdt2PKKg7w7Wi1QhkV/Uoj8/5+oM=;\n\tb=KfK7r0F9v2NpOvyCi9Jt51p+TRg9AJdvvD+iP2LfJrfoNoEKeQUZf0wOSkPFmrGYuf\n\tp99JxvRUpsLZ/tNEsdSaaJY0DnpMG43/J/dCvexZwVKqaA/8VPM4XA/EBML9fFI5iS8e\n\tFrS9ITwI4ER6ts8ZfI/MBJIAUsyUutghKL/Wk=","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=0w6ecWqyvcQ2TYthdt2PKKg7w7Wi1QhkV/Uoj8/5+oM=;\n\tb=dpgRF5BW/+V8xR4BrVIyr+pE2g6osIcIOB9PJtbif7Unmr/DeH5X2zU7LJCi6pWyvM\n\t7uiGaGbrlK+1HHT8+NQs57mdvSvkhAItCuFFQ6KtSs0SuY1eDzU1DrLfGVgMoxTUMhPb\n\tJsWtdz0HHgSh6dk3iS75rmOgxjplu/AkBvNPwpZtxpJ2Q6dvFu+f8BAJq8purUk3MZyi\n\ttS9G6d/9nlwMvpjM33BWAfPht/ZSFdJZzM4TylvFDyip6sJf4RgZYD2242DNW+zIqnHL\n\t/MHprypheptDU9eZw+Nk5pvnfNduXgLZOvTf6nmIb0erUX5OB9jRYwCus3CAIVC1Gxts\n\tXUNg==","X-Gm-Message-State":"AOAM530mZTfjKPVXafvLkuJhL9zrTmoCyG83mhwo1j9pNhrmfsM8oxth\n\ttnkv2zr9ZeQtjxZPVs846cKueih93d0dkA==","X-Google-Smtp-Source":"ABdhPJyPra9B3FwvXMINrevVE5mJ93prKCV0uBesdYadE6Nyq8RgJofoEs5VIkhhucPXRCRsqckQww==","X-Received":"by 2002:a63:2066:: with SMTP id\n\tr38mr57829304pgm.389.1636351303554; \n\tSun, 07 Nov 2021 22:01:43 -0800 (PST)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  8 Nov 2021 15:01:35 +0900","Message-Id":"<20211108060135.370781-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.34.0.rc0.344.g81b53c2807-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] lc-compliance: Build with googltest in\n\tsubproject","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. The compiler and linker\nto create the static library might be different from ones used for\nlibcamera. This causes a problem upon linking.\n\nThis puts googltest 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>\n---\n README.rst                    |  2 +-\n src/lc-compliance/meson.build | 14 ++++++++++----\n subprojects/.gitignore        |  4 +++-\n subprojects/gtest.wrap        | 15 +++++++++++++++\n 4 files changed, 29 insertions(+), 6 deletions(-)\n create mode 100644 subprojects/gtest.wrap","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..4d13ad00 100644\n--- a/src/lc-compliance/meson.build\n+++ b/src/lc-compliance/meson.build\n@@ -1,15 +1,21 @@\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 get_option('lc-compliance').enabled()\n     lc_compliance_enabled = false\n     subdir_done()\n endif\n \n lc_compliance_enabled = true\n \n+libevent = dependency('libevent_pthreads', required : true)\n+\n+if get_option('android_platform') == 'cros'\n+   libgtest = dependency('gtest', required : true)\n+else\n+   libgtest_sp = subproject('gtest')\n+   libgtest = libgtest_sp.get_variable('gtest_dep')\n+endif\n+\n lc_compliance_sources = files([\n     '../cam/event_loop.cpp',\n     '../cam/options.cpp',\ndiff --git a/subprojects/.gitignore b/subprojects/.gitignore\nindex 410b8bd6..82ef2c83 100644\n--- a/subprojects/.gitignore\n+++ b/subprojects/.gitignore\n@@ -1 +1,3 @@\n-/libyuv\n\\ No newline at end of file\n+/libyuv\n+/googletest-release*\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..8513793f\n--- /dev/null\n+++ b/subprojects/gtest.wrap\n@@ -0,0 +1,15 @@\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+\n","prefixes":["libcamera-devel"]}