[{"id":16097,"web_url":"https://patchwork.libcamera.org/comment/16097/","msgid":"<YGe4w1Ph2odQY1cz@pendragon.ideasonboard.com>","date":"2021-04-03T00:37:23","subject":"Re: [libcamera-devel] [PATCH v3 1/4] android: Define CHROMEOS macro\n\tif android_platform=cros","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 Tue, Mar 30, 2021 at 02:25:18PM +0900, Hirokazu Honda wrote:\n> Android Camera HAL 3 API used in ChromeOS has a ChromeOS own\n> extension, for example, crop_rotate_scale_degrees in\n> camera3_stream. To avoid breaking bisection for platforms using\n> the API without the extensions, this introduce CHROMEOS macro,\n> which is defined if and only if android_platform is 'cros'.\n\nThe main purpose of the macro isn't so much to avoid breaking bisection,\nbut to avoid breaking compilation :-) How about\n\n\"As those extensions are not available on Android platforms, introduce a\nCHROMEOS macro that can be used to compile CrOS-specific code\nconditionally. The macro is defined if and only if android_platform is\n'cros'.\"\n\n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> ---\n>  src/android/meson.build   | 6 ++++++\n>  src/libcamera/meson.build | 6 ++++++\n>  2 files changed, 12 insertions(+)\n> \n> diff --git a/src/android/meson.build b/src/android/meson.build\n> index 8e7d07d9..00a3d86b 100644\n> --- a/src/android/meson.build\n> +++ b/src/android/meson.build\n> @@ -35,6 +35,12 @@ endif\n>  \n>  android_deps += [libyuv_dep]\n>  \n> +android_cpp_args = []\n> +\n> +if get_option('android_platform') == 'cros'\n> +   android_cpp_args += [ '-DCHROMEOS']\n\nLooking at\nhttps://chromium.googlesource.com/chromium/src/build/+/refs/heads/master/config/linux/BUILD.gn,\nI wonder if we should use OS_CHROMEOS instead of CHROMEOS.\n\n> +endif\n> +\n>  subdir('cros')\n>  \n>  android_hal_sources = files([\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 815629db..c0443fd2 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -131,10 +131,13 @@ libcamera_deps = [\n>  \n>  libcamera_link_with = []\n>  \n> +libcamera_cpp_args = []\n> +\n\nYou can declare this in src/meson.build, just above libcamera_objects.\n\n>  if android_enabled\n>      libcamera_sources += android_hal_sources\n>      includes += android_includes\n>      libcamera_link_with += android_camera_metadata\n> +    libcamera_cpp_args += android_cpp_args\n\nThen this could be dropped, with and above android_cpp_args replaced\nwith libcamera_cpp_args.\n\n>  \n>      libcamera_deps += android_deps\n>  endif\n> @@ -144,10 +147,13 @@ endif\n>  # runtime if the library is running from an installed location by checking\n>  # for the presence or abscence of the dynamic tag.\n>  \n> +message(libcamera_cpp_args)\n> +\n\nIs this a test leftover ?\n\nWith those small issues addressed,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  libcamera = shared_library('camera',\n>                             libcamera_sources,\n>                             install : true,\n>                             link_with : libcamera_link_with,\n> +                           cpp_args : libcamera_cpp_args,\n>                             include_directories : includes,\n>                             objects : libcamera_objects,\n>                             build_rpath : '/',","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 679A0BD695\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  3 Apr 2021 00:38:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C2536602CF;\n\tSat,  3 Apr 2021 02:38:09 +0200 (CEST)","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 802F0602CF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Apr 2021 02:38:08 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E71583D7;\n\tSat,  3 Apr 2021 02:38:07 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hsPiT+1Z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617410288;\n\tbh=xMg6Tztd0q4ZC5ZbC+TErv+A0JjOusEHWRCDKrcGJRk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hsPiT+1Z8Y7D7tSLS3wMmqbi955So6rb4pcMcV67g/PL3mechMaZli104EJBdl3Sc\n\tcpV4GIRrHeQONnyEZrr7xZ7uz1Zh+98ckIlrGrZ9NUQ9p9Z0RSz6EMJ08sU3F4ieul\n\t5lLfANCOvQEBL+wXluvCP17H7JAGo/kWbxllSJ1M=","Date":"Sat, 3 Apr 2021 03:37:23 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YGe4w1Ph2odQY1cz@pendragon.ideasonboard.com>","References":"<20210330052521.381550-1-hiroh@chromium.org>\n\t<20210330052521.381550-2-hiroh@chromium.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210330052521.381550-2-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH v3 1/4] android: Define CHROMEOS macro\n\tif android_platform=cros","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","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]