[{"id":29,"web_url":"https://patchwork.libcamera.org/comment/29/","msgid":"<212e834b-e4ec-ce90-8e3a-769aa1307b73@ideasonboard.com>","date":"2018-12-06T14:21:58","subject":"Re: [libcamera-devel] [PATCH 1/3] Overhaul the directory structure","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 04/12/2018 22:11, Laurent Pinchart wrote:\n> In order to match the directory structure of traditional projects,\n> rename the top-level lib/ directory to src/libcamera/. Other libraries\n> developed as part of the project will later find a home in src/.\n> \n> Split the libcamera header files in three categories: public headers\n> describing the public API in include/libcamera/, internal headers\n> describing the internal API in src/libcamera/include/, and private\n> headers local to one or a small number of compilation units along the\n> corresponding .cpp files. As no internal header exists yet the\n> src/libcamera/include/ directory is created empty as the build system\n> would fail otherwise.\n> \n\nI like how you've updated the includes so that the shared library has\nprotected header includes, but the tests only have public.\n\nPerhaps we might need to distinguish this so that we can be more\nselective on tests, and have a libcamera_public includes and a\nlibcamera_protected includes (which also includes public) so that we can\nhave tests on the protected API's too.\n\nBut - we don't have any protected tests yet - so not something worth\nrequiring a v2 unless you want to update.\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nEither way:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  meson.build                        | 4 ++--\n>  src/libcamera/include/.keep_empty  | 0\n>  {lib => src/libcamera}/main.cpp    | 0\n>  {lib => src/libcamera}/meson.build | 7 ++++++-\n>  src/meson.build                    | 1 +\n>  test/meson.build                   | 2 +-\n>  6 files changed, 10 insertions(+), 4 deletions(-)\n>  create mode 100644 src/libcamera/include/.keep_empty\n>  rename {lib => src/libcamera}/main.cpp (100%)\n>  rename {lib => src/libcamera}/meson.build (50%)\n>  create mode 100644 src/meson.build\n> \n> diff --git a/meson.build b/meson.build\n> index e0aeefa30330..e6ed03f951c7 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -21,11 +21,11 @@ cpp_arguments = common_arguments\n>  add_project_arguments(c_arguments, language: 'c')\n>  add_project_arguments(cpp_arguments, language: 'cpp')\n>  \n> -inc = include_directories('include')\n> +libcamera_includes = include_directories('include')\n\nIt might be worth naming this libcamera_public\n\n\n>  \n>  subdir('Documentation')\n>  subdir('include')\n> -subdir('lib')\n> +subdir('src')\n>  subdir('test')\n>  subdir('utils')\n>  \n> diff --git a/src/libcamera/include/.keep_empty b/src/libcamera/include/.keep_empty\n> new file mode 100644\n> index 000000000000..e69de29bb2d1\n> diff --git a/lib/main.cpp b/src/libcamera/main.cpp\n> similarity index 100%\n> rename from lib/main.cpp\n> rename to src/libcamera/main.cpp\n> diff --git a/lib/meson.build b/src/libcamera/meson.build\n> similarity index 50%\n> rename from lib/meson.build\n> rename to src/libcamera/meson.build\n> index fcd738cc86d8..07d9cd448342 100644\n> --- a/lib/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -1,6 +1,11 @@\n>  sources = ['main.cpp']\n>  \n\nAnd adding:\nlibcamera_protected = include_directories('include')\n\nhere,\n\n> +includes = [\n> +    libcamera_includes,\n> +    include_directories('include'),\n> +]\n> +\n>  libcamera = shared_library('camera',\n>                             sources,\n>                             install : true,\n> -                           include_directories : inc)\n> +                           include_directories : includes)\n> diff --git a/src/meson.build b/src/meson.build\n> new file mode 100644\n> index 000000000000..4ce9668caa7b\n> --- /dev/null\n> +++ b/src/meson.build\n> @@ -0,0 +1 @@\n> +subdir('libcamera')\n> diff --git a/test/meson.build b/test/meson.build\n> index afe9bd9a741c..924a26f1ca66 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -1,5 +1,5 @@\n>  test_init = executable('test_init', 'init.cpp',\n>                         link_with : libcamera,\n> -                       include_directories : inc)\n> +                       include_directories : libcamera_includes)\n\nThen it would be clear that this was only able to access the public API.\n\n\n>  \n>  test('Initialisation test', test_init)\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["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 D07CC60B0B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Dec 2018 15:22:01 +0100 (CET)","from [192.168.0.21]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 37BBB59;\n\tThu,  6 Dec 2018 15:22:01 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1544106121;\n\tbh=39oVY6tBcMXeIU1PgX7LWXI7QgLXBtdbNBR7IC444ng=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=TXk0NOItMNPpyXg9nR5lgOvje1LyEdv0YiBZ/T0K7zHL5XootJp2BD7OmMmWk1VYE\n\tyswZZVc9ToqgZP8IEudmjuaX4wSDlrM/Sxa2/uLQ2X5v1MWhx8ihCnGuXELqh72cl9\n\tNTMuYMAGlPRIAvs8V9vCT20GtkT59YcTlGCm0Xk0=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20181204221123.571-1-laurent.pinchart@ideasonboard.com>\n\t<20181204221123.571-2-laurent.pinchart@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\txsFNBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH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/esHPuHNwX4guqTbVEuRqbDzDI\n\t2DJO5FbxABEBAAHCwWUEGAEKAA8CGwwFAlnDlGsFCQeA/gIACgkQoR5GchCkYf1yYRAAq+Yo\n\tnbf9DGdK1kTAm2RTFg+w9oOp2Xjqfhds2PAhFFvrHQg1XfQR/UF/SjeUmaOmLSczM0s6XMeO\n\tVcE77UFtJ/+hLo4PRFKm5X1Pcar6g5m4xGqa+Xfzi9tRkwC29KMCoQOag1BhHChgqYaUH3yo\n\tUzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO\n\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<212e834b-e4ec-ce90-8e3a-769aa1307b73@ideasonboard.com>","Date":"Thu, 6 Dec 2018 14:21:58 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.2.1","MIME-Version":"1.0","In-Reply-To":"<20181204221123.571-2-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH 1/3] Overhaul the directory structure","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Thu, 06 Dec 2018 14:22:02 -0000"}},{"id":32,"web_url":"https://patchwork.libcamera.org/comment/32/","msgid":"<1749910.JbRookCb9y@avalon>","date":"2018-12-06T14:42:42","subject":"Re: [libcamera-devel] [PATCH 1/3] Overhaul the directory structure","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Thursday, 6 December 2018 16:21:58 EET Kieran Bingham wrote:\n> On 04/12/2018 22:11, Laurent Pinchart wrote:\n> > In order to match the directory structure of traditional projects,\n> > rename the top-level lib/ directory to src/libcamera/. Other libraries\n> > developed as part of the project will later find a home in src/.\n> > \n> > Split the libcamera header files in three categories: public headers\n> > describing the public API in include/libcamera/, internal headers\n> > describing the internal API in src/libcamera/include/, and private\n> > headers local to one or a small number of compilation units along the\n> > corresponding .cpp files. As no internal header exists yet the\n> > src/libcamera/include/ directory is created empty as the build system\n> > would fail otherwise.\n> \n> I like how you've updated the includes so that the shared library has\n> protected header includes, but the tests only have public.\n> \n> Perhaps we might need to distinguish this so that we can be more\n> selective on tests, and have a libcamera_public includes and a\n> libcamera_protected includes (which also includes public) so that we can\n> have tests on the protected API's too.\n> \n> But - we don't have any protected tests yet - so not something worth\n> requiring a v2 unless you want to update.\n\nIt's a good idea. Let's do so when we'll add unit tests :-)\n\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Either way:\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > ---\n> > \n> >  meson.build                        | 4 ++--\n> >  src/libcamera/include/.keep_empty  | 0\n> >  {lib => src/libcamera}/main.cpp    | 0\n> >  {lib => src/libcamera}/meson.build | 7 ++++++-\n> >  src/meson.build                    | 1 +\n> >  test/meson.build                   | 2 +-\n> >  6 files changed, 10 insertions(+), 4 deletions(-)\n> >  create mode 100644 src/libcamera/include/.keep_empty\n> >  rename {lib => src/libcamera}/main.cpp (100%)\n> >  rename {lib => src/libcamera}/meson.build (50%)\n> >  create mode 100644 src/meson.build\n> > \n> > diff --git a/meson.build b/meson.build\n> > index e0aeefa30330..e6ed03f951c7 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -21,11 +21,11 @@ cpp_arguments = common_arguments\n> > \n> >  add_project_arguments(c_arguments, language: 'c')\n> >  add_project_arguments(cpp_arguments, language: 'cpp')\n> > \n> > -inc = include_directories('include')\n> > +libcamera_includes = include_directories('include')\n> \n> It might be worth naming this libcamera_public\n> \n> >  subdir('Documentation')\n> >  subdir('include')\n> > -subdir('lib')\n> > +subdir('src')\n> >  subdir('test')\n> >  subdir('utils')\n> > \n> > diff --git a/src/libcamera/include/.keep_empty\n> > b/src/libcamera/include/.keep_empty new file mode 100644\n> > index 000000000000..e69de29bb2d1\n> > diff --git a/lib/main.cpp b/src/libcamera/main.cpp\n> > similarity index 100%\n> > rename from lib/main.cpp\n> > rename to src/libcamera/main.cpp\n> > diff --git a/lib/meson.build b/src/libcamera/meson.build\n> > similarity index 50%\n> > rename from lib/meson.build\n> > rename to src/libcamera/meson.build\n> > index fcd738cc86d8..07d9cd448342 100644\n> > --- a/lib/meson.build\n> > +++ b/src/libcamera/meson.build\n> > @@ -1,6 +1,11 @@\n> > \n> >  sources = ['main.cpp']\n> \n> And adding:\n> libcamera_protected = include_directories('include')\n> \n> here,\n> \n> > +includes = [\n> > +    libcamera_includes,\n> > +    include_directories('include'),\n> > +]\n> > +\n> >  libcamera = shared_library('camera',\n> >                             sources,\n> >                             install : true,\n> > -                           include_directories : inc)\n> > +                           include_directories : includes)\n> > diff --git a/src/meson.build b/src/meson.build\n> > new file mode 100644\n> > index 000000000000..4ce9668caa7b\n> > --- /dev/null\n> > +++ b/src/meson.build\n> > @@ -0,0 +1 @@\n> > +subdir('libcamera')\n> > diff --git a/test/meson.build b/test/meson.build\n> > index afe9bd9a741c..924a26f1ca66 100644\n> > --- a/test/meson.build\n> > +++ b/test/meson.build\n> > @@ -1,5 +1,5 @@\n> > \n> >  test_init = executable('test_init', 'init.cpp',\n> >                         link_with : libcamera,\n> > -                       include_directories : inc)\n> > +                       include_directories : libcamera_includes)\n> \n> Then it would be clear that this was only able to access the public API.\n> \n> >  test('Initialisation test', test_init)","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7C36360B0B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Dec 2018 15:42:06 +0100 (CET)","from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E76FE595;\n\tThu,  6 Dec 2018 15:42:05 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1544107326;\n\tbh=8IE1nAw8LlEt0KbXDRTMf653NGaV8MjgTRhmbRd/98Q=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=vec8966+gmCx/p8LhDpQjsv4+DxbMRLhEbKcKVRwEvI6WX0yMWVFnHQwzmEW5twXX\n\trO++h6ZPtkUH4sG7L/vT1jI34rLGj/9vxXVZ5T5SQJyY7IEIrEY3m81kHN8nsF6/Ba\n\tBuQnBpraNzm981TigQCO/0nzQc6RpOlRM5yMhVtw=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"kieran.bingham@ideasonboard.com","Cc":"libcamera-devel@lists.libcamera.org","Date":"Thu, 06 Dec 2018 16:42:42 +0200","Message-ID":"<1749910.JbRookCb9y@avalon>","Organization":"Ideas on Board Oy","In-Reply-To":"<212e834b-e4ec-ce90-8e3a-769aa1307b73@ideasonboard.com>","References":"<20181204221123.571-1-laurent.pinchart@ideasonboard.com>\n\t<20181204221123.571-2-laurent.pinchart@ideasonboard.com>\n\t<212e834b-e4ec-ce90-8e3a-769aa1307b73@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"7Bit","Content-Type":"text/plain; charset=\"us-ascii\"","Subject":"Re: [libcamera-devel] [PATCH 1/3] Overhaul the directory structure","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Thu, 06 Dec 2018 14:42:06 -0000"}}]