[{"id":20925,"web_url":"https://patchwork.libcamera.org/comment/20925/","msgid":"<YY6TJeX/i7p7ZmLG@pendragon.ideasonboard.com>","date":"2021-11-12T16:15:33","subject":"Re: [libcamera-devel] [PATCH v4] lc-compliance: Build with gtest in\n\tsubprojects","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThank you for the patch.\n\nOn Fri, Nov 12, 2021 at 03:29:48PM +0900, Hirokazu Honda wrote:\n> libgtest-dev is provided as a static library at least by Debian 10.\n> The compiler and linker to create the static library might be\n> different from ones used for libcamera. This causes a problem\n> upon linking.\n> \n> This puts gtest code to subprojects, builds the code and link it\n> for lc-compliance. However, libgtest is locally built as a library on\n> ChromeOS and thus the used compiler and linker are the same as one\n> used for libcamera. We don't do these on ChromeOS build environment.\n> \n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> Tested-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\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> diff --git a/README.rst b/README.rst\n> index 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>  ~~~~~~~~~~~~~~~~~~~~~~\n> diff --git a/src/lc-compliance/meson.build b/src/lc-compliance/meson.build\n> index 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([\n> diff --git a/subprojects/.gitignore b/subprojects/.gitignore\n> index 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\n> diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap\n> new file mode 100644\n> index 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","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 32167BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Nov 2021 16:15:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 588836036B;\n\tFri, 12 Nov 2021 17:15:57 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E437E6032C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Nov 2021 17:15:55 +0100 (CET)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7707D268;\n\tFri, 12 Nov 2021 17:15:55 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Fk3YCSHe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636733755;\n\tbh=+tKdyS7mttQSf2ACQjV4R64N6WX/dTMAnJIUsvMhQE0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Fk3YCSHenqxl6UXO9OqNtAW59JxweiDxzRUor7X2j0Jyn5Pm+lYJIaUlq+cBihif0\n\tnIT4N31KiziGnp9BHXfIPOwmuNApl1ipNPWGa9M6BBhPPWTZmSOfbADrm2LSUY/LYo\n\tQlXHsJM9xEPsnWnscDsSy6pq7l7ruHEvPmg8hCtc=","Date":"Fri, 12 Nov 2021 18:15:33 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YY6TJeX/i7p7ZmLG@pendragon.ideasonboard.com>","References":"<20211112062948.1432821-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211112062948.1432821-1-hiroh@chromium.org>","Subject":"Re: [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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20927,"web_url":"https://patchwork.libcamera.org/comment/20927/","msgid":"<163673417701.2717916.14441743139221670445@Monstersaurus>","date":"2021-11-12T16:22:57","subject":"Re: [libcamera-devel] [PATCH v4] lc-compliance: Build with gtest in\n\tsubprojects","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-11-12 16:15:33)\n> Hi Hiro,\n> \n> Thank you for the patch.\n> \n> On Fri, Nov 12, 2021 at 03:29:48PM +0900, Hirokazu Honda wrote:\n> > libgtest-dev is provided as a static library at least by Debian 10.\n> > The compiler and linker to create the static library might be\n> > different from ones used for libcamera. This causes a problem\n> > upon linking.\n> > \n> > This puts gtest code to subprojects, builds the code and link it\n> > for lc-compliance. However, libgtest is locally built as a library on\n> > ChromeOS and thus the used compiler and linker are the same as one\n> > used for libcamera. We don't do these on ChromeOS build environment.\n> > \n> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > Tested-by: Jacopo Mondi <jacopo@jmondi.org>\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nUmang has also already provided:\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\nin <736c63c4-301e-2d04-d91c-a8b5c3b1df45@ideasonboard.com> but it got\nlost when reposting as v4.\n\n(Posting here so that patchwork collects it)\n--\nKieran\n\n\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> > diff --git a/README.rst b/README.rst\n> > index 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> >  ~~~~~~~~~~~~~~~~~~~~~~\n> > diff --git a/src/lc-compliance/meson.build b/src/lc-compliance/meson.build\n> > index 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([\n> > diff --git a/subprojects/.gitignore b/subprojects/.gitignore\n> > index 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\n> > diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap\n> > new file mode 100644\n> > index 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> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 2C651BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Nov 2021 16:23:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7A75D6036B;\n\tFri, 12 Nov 2021 17:23:01 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 24AE86032C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Nov 2021 17:23:00 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7BF6A4A6;\n\tFri, 12 Nov 2021 17:22:59 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"uvwarMNR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636734179;\n\tbh=dL06BHq4aBX8dtKd0oscpLlY1MHO0fhky2Txllccuk0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=uvwarMNRvFi8O5y5J35JON8I2tz5HVeE53ZPfAJRn5/mf3ZtXYCvSPLClI6uVMU/K\n\tvSsak+pi2vgTlEMFjMwD7dBpgsEDLMIWgKDOja6/8TIk/Reaptn0cLPVZhOfdvC3lx\n\teehm/a/iiiE6G3NXqbNmXu41Au1RG88rnmT+q5BY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YY6TJeX/i7p7ZmLG@pendragon.ideasonboard.com>","References":"<20211112062948.1432821-1-hiroh@chromium.org>\n\t<YY6TJeX/i7p7ZmLG@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Fri, 12 Nov 2021 16:22:57 +0000","Message-ID":"<163673417701.2717916.14441743139221670445@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]