Age | Commit message (Collapse) | Author |
|
Add 'check: true/false' to all run_command() calls as suggested in
https://github.com/mesonbuild/meson/issues/9300 to get rid of meson
warning "You should add the boolean check kwarg to the run_command
call."
This makes meson fail if the executed command fails, which makes sense.
[Kieran: Ignore failures on utils/genversion.sh]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
meson.source_root() and meson.build_root() are deprecated. Use
meson.project_source_root() and meson.project_build_root() instead.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Ubuntu 22.04 LTS has been released with meson 0.61.2, and it is easy to
install a recent version of meson with python-pip, so let's update the
required meson version to get rid of the Android compilation
limitation.
Additionally, going to meson 0.55 gives the ability to have patch files
for git-wraps which is useful for Python bindings.
0.56 brings meson.project_source_root() and meson.project_build_root(),
allowing us to get rid of the deprecated meson.source_root() and
meson.build_root().
So, let's update the required meson version to 0.56.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
gcc 7 has reached end of life and isn't used as a default compiler by
any of the major distributions. It has also been dropped from buildroot.
Drop its support in libcamera.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
Building the libcamera Android layer currently makes use of features
from meson 0.55. The core libcamera framework in the default configuration
without android enabled uses the 'summary' feature available in 0.53, and
is the lowest supportable meson version if the Android HAL is excluded.
Ubuntu 20.04 LTS currently provides meson 0.53 and represents an
acceptable minimum version to support. Platforms utilising the Android
component will have full control over their build environment and can
ensure that they provide a more recent version of meson.
Reduce the supported meson version for the project to 0.53 to facilitate
building on more distributions without having to manually update the
meson package.
Meson will output a warning that features not available in 0.53 are used
if the Android HAL is enabled. This is considered as an acceptable
middleground to improve the experience on the latest Ubuntu LTS, until
22.04 LTS is released and provides a newer meson version.
Signed-off-by: Christian Rauch <Rauch.Christian@gmx.de>
[Kieran: Add comment about the android meson requirements]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Clang compiler is able to do a thread safety analysis with
annotations [1]. This introduces the thread safety annotation
macros and also enable the analysis by adding -Wthread-safety
if a clang compiler is used.
[1] https://clang.llvm.org/docs/ThreadSafetyAnalysis.html.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The meson option summary currently does not report if the support
for tracing is enabled or not. Add it.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
When distributions build and package libcamera libraries, they may not
necessarily run the build in the upstream source tree. In these cases, the git
SHA1 versioning information will be lost.
This change addresses that problem by requiring package managers to run
'meson dist' to create a tarball of the source files and build from there.
On runing 'meson dist', the utils/run-dist.sh script will create a
.tarball-version file in the release tarball with the version string generated
from the existing utils/gen-version.sh script.
The utils/gen-version.sh script has been updated to check for the presence of
this .tarball-version file and read the version string from it instead of
creating one.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The gen-version.sh script expects to be called from a git repo, and sets its
src_root variable accordingly. This may not always be the case if it is built
from a tarball source - full support for which is in a future commit.
The MESON_SOURCE_ROOT environnement variable does not get set when called from
the meson vcs_tag() function, but does when called from the run_command()
function, so that cannot be used either.
Instead, explicitly pass the meson source root to the gen-version.sh script.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Create a new class to abstract generation and access to call stack
backtraces. The current implementation depends on the glibc backtrace()
implementation and is copied from the logger. Future development will
bring support for libunwind, transparently for the users of the class.
The logger backtrace implementation is dropped, replaced by usage of the
new Backtrace class.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
In preparation for using the AGC through the new algorithm interfaces,
convert the existing code to use the new function types.
Now that the process call is rewritten, re-enable the compiler flag to
warn when a function declaration hides virtual functions from a base class
(-Woverloaded-virtual).
We never use converged_ so remove its declaration. The controls may not
need to be updated at each call, but it should be decided on the context
side and not by a specific call by using a lock status in the Agc
structure for instance.
As the params_ local variable is not useful anymore, remove it here
too.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Introduce three functions in the Algorithm class to manage algorithms:
- configure which is called when IPA is configured only
- prepare called on EventFillParams event at each frame when the request
is queued
- process called on EventStatReady event at each frame completion when
the statistics have been generated.
The existing AGC implementation already has a function named process(),
though it has different arguments. Adding the new virtual process()
interface causes a compiler warning due to the AGC implementation
overloading a virtual function, even though the overload can be resolved
correctly.
Temporarily disable the warning in this commit to maintain bisection
until the AGC is converted to the new interface.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
__builtin_FILE and __builtin_LINE are first defined in clang 9. With
clang of any version less than that we have the following compilation
errors:
../../include/libcamera/base/log.h:94:27: error: use of undeclared identifier '__builtin_FILE'
const char *fileName = __builtin_FILE(),
^
../../include/libcamera/base/log.h:95:24: error: use of undeclared identifier '__builtin_LINE'
unsigned int line = __builtin_LINE()) const;
^
../../include/libcamera/base/log.h:99:26: error: use of undeclared identifier '__builtin_FILE'
const char *fileName = __builtin_FILE(),
^
../../include/libcamera/base/log.h:100:23: error: use of undeclared identifier '__builtin_LINE'
unsigned int line = __builtin_LINE());
Enforce clang version of at least 9 in the main meson file.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The pkg-config file for the main libcamera.so is generated
at the top level meson.build.
Move this to the actual core libcamera build structure to be
consistent and keep it next to the library construction.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Android provides neither secure_getenv() nor issetugid(). Enable
compilation on that platform by using a plain getenv(), as that seems to
be the best we can do.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Boolean options in the summary are printed as 'True' or 'False' by
default. Enable the bool_yn option, which prints them as 'YES' or 'NO',
in green and red respectively. This makes the summary more readable.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
On gcc versions older than 9, the file system library, used by the
Android camera HAL configuration file parser, is implemented in a
separate static library. Furthermore, on gcc 7, it's provided in the
std::experimental namespace. This breaks compilation of the HAL on gcc
7, and linking on gcc 8.
Fix the compilation issue by conditionally including
<experimental/filesystem> and creating a namespace alias in std, and the
link issue by linking to libstdc++fs on gcc versions older than 9.
The inclusion of <experimental/filesystem> is a bit of a hack, and when
we'll start using the file system library in another compilation unit,
we should then move all this to an internal helper to abstract the
compiler version.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
There can be multiple IPAs per pipeline-handler or platform.
They can live in-tree or externally linked. It is up to the vendor
whether to use in-tree IPA for a platform or provide it externally.
In the case of IPAs being external, building in-tree IPAs might be
futile hence, provide a clear and explicit mechanism to choose whether
to build the in-tree IPA for the platform or not.
By default, all in-tree IPAs are built when a matching Pipeline handler
is also enabled.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Since meson v0.49.0, join_paths() is equivalent to '/' hence,
drop and replace it with '/' short-hand in meson files.
This commit does not introduce any functional changes.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Add a compliance tool to ease testing of cameras. In contrast to the
unit-tests under test/ that aims to test the internal components of
libcamera the compliance tool aims to test application use-cases and to
some extent the public API.
This change adds the boilerplate code of a simple framework for the
creation of tests. The tests aim both to demonstrate the tool and to
catch real problems. The tests added are:
- Test that if one queues exactly N requests to a camera exactly N
requests are eventually completed.
- Test that a configured camera can be started and stopped multiple
times in an attempt to exercise cleanup code paths otherwise not
often tested with 'cam' for example.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
|
|
Add the application and adaptation layers being built to the meson
summary. The summary now prints
libcamera 0.0.0
Configuration
Enabled pipelines: ipu3
raspberrypi
rkisp1
simple
uvcvideo
vimc
Android support: True
GStreamer support: True
V4L2 emulation support: True
cam application: True
qcam application: True
Unit tests: True
Subprojects
libyuv: YES
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
|
|
The addition of the new IPA IPC mechanism compiles pipeline-specific
headers to define the interface between the pipeline and the IPA.
This was optimised in 08ce394465b5 ("meson: ipa, proxy: Only build
proxies for enabled pipelines") to only build for enabled pipelines,
however the tests directly use the VIMC pipeline handler, and require
it to be built.
Create a local variable to store the requested pipelines from the user
configuration and extend the enabled pipelines to ensure that VIMC is
always enabled if the tests are also enabled
Fixes: 08ce394465b5 ("meson: ipa, proxy: Only build proxies for enabled pipelines")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Sebastian Fricke<sebastian.fricke@posteo.net>
|
|
Android HAL adaptation layer may need image processing, for
example, scaling and format conversion. Libyuv is a general image
processing. This adds libyuv to subprojects, so that it is forked
locally and can be used with Android HAL implementation code.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Now that Debian backports have been updated to meson v0.56, all major
distributions provide meson >= v0.53 in their latest LTS version. We can
replace the manual message()-based configuration summary with the
summary() function.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Utilise the subdir_done() functionality as is used with other optional
components to simplify the top level meson file.
Suggested-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Implement tracing infrastructure in libcamera. It takes .tp files, as
required by lttng, and generates a tracepoint header and C file, as lttng
requires. meson is updated accordingly to get it to compile with the
rest of libcamera. Update the documentation accordingly.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Shadowing variables can lead to unexpected bugs where a code path
utilises a variable that may not have been intended by the developer,
leading to hard to find bugs.
Enable warnings for shadowed variables as defined at:
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wshadow
As an effect of utilising -Werror, this will cause variable or type
shadowing to become a build-time error.
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The option, -Wextra-semi, helps developers to find unnecessary
semicolons. This option is available with clang.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
I get the warnings related to psabi with:
gcc 9.3.0 "arm-buildroot-linux-gnueabihf-g++.br_real (Buildroot 2020.08-24-gc5c5f1fa46) 9.3.0"
Remove the check for gcc-9, so that -Wno-psabi is used on all gcc
versions over 7.1.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
With this change, meson will complain specifically about missing
python3 and missing python3-yaml. As specified by meson
documentation: https://mesonbuild.com/Python-module.html,
this change requires meson v0.51.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Version 0.51 allows, among others, checking for python modules, which is
a required feature.
It is also now easily accessible: it is in stable distros such as Debian
testing, or in pip:
https://tracker.debian.org/pkg/meson
https://pypi.org/project/meson/
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
This way if the user enables the documentation and the dependencies are
missing the configure fails.
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The utils directory can contain helpers and support tools which are used
throughout other components of the build.
Ensure that the utils subdir is parsed first allowing helpers to be
defined there.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
The viewfinderGL accelerates the format conversion by using OpenGL ES
shader.
The minimum Qt version is bumped to v5.4, as QOpenGLWidget wasn't
available before that.
Signed-off-by: Show Liu <show.liu@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Report the enabled pipelines when configuring the meson build hierarchy.
This helps clarify what pipelines are used when building, and is useful
when looking back through build-traces to see what was actually
configured.
This can be expanded upon to report other options, and ideally will be
replaced by mesons summary() functionality when it is available.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
We build libcamera with -Wno-unused-parameter and this doesn't cause
much issue internally. However, it prevents catching unused parameters
in inline functions defined in public headers. This can lead to
compilation warnings for applications compiled without
-Wno-unused-parameter.
To catch those issues, remove -Wno-unused-parameter and fix all the
related warnings with [[maybe_unused]].
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Due to popular request, move from C++14 to C++17. This will allow
dropping some custom constructs (such as a custom utils::clamp),
benefiting from new language features, and dropping gcc 5 and 6 from the
compilation tests.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Add kernel version detection to warn user
that only >= 5.0.0 V4L API are supported in
libcamera.
Signed-off-by: Stéphane Cerveau <scerveau@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
In an attempt to clarify the license terms of all files in the libcamera
project, the build system files deserve particular attention. While they
describe how the binaries are created, they are not themselves
transformed into any part of binary distributions of the software, and
thus don't influence the copyright on the binary packages. They are
however subject to copyright, and thus influence the distribution terms
of the source packages.
Most of the meson.build files would not meet the threshold of
originality criteria required for copyright protection. Some of the more
complex meson.build files may be eligible for copyright protection. To
avoid any ambiguity and uncertainty, state our intent to not assert
copyrights on the build system files by putting them in the public
domain with the CC0-1.0 license.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Acked-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Acked-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Acked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Paul Elder <paul.elder@ideasonboard.com>
Acked-by: Show Liu <show.liu@linaro.org>
|
|
Should be $includedir/libcamera, as we install into a subdirectory name
'libcamera'. This is fixed by passing the 'subdirs' argument to the pkgconfig
generator.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
gcc 7.1 introduced processor-specific ABI breakages related to parameter
passing on ARM platforms. This generates a large number of messages
during compilation with gcc >=7.1 until gcc 9. Silence them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Similarly to libcameraBuildPath(), there's a need to locate resources
within the source tree when running libcamera without installing it.
Support this use case with a new utils::libcameraSourcePath() function.
The implementation uses a symlink from the build root to the source root
in order to avoid hardcoding the path to the source root in the
libcamera.so binary.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
We use array designators for array initialization, which is a C99
extension. clang-10 warns about it, causing a build failure.
As this is a useful extension, silence the warning. This needs to be
done only if the compiler supports the -Wno-c99-designator argument,
otherwise a -Wunknown-warning-option will be generated.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
This is needed to use option type 'feature'. This is a tri-state
(auto/enabled/disabled) which comes with utility to enable them all, or
disabled them all to avoid any dynamic selection happening. It can also
be used as value to any "required" field.
This will be used in GStreamer support. If you don't have a recent enough
meson in your distribution, you can always install or upgrade your version
using pip3.
pip3 install --user meson
pip3 install --user --upgrade meson
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
C++14 is a minor release that doesn't introduce major new concepts or
paradigms compared to C++11, but brings two useful changes for us:
- std::make_unique allows dropping our custom implementation in utils.
- Functions returning constexpr are not assumed to be const anymore,
which is needed to create a standard-conformant span implementation.
All the g++ and clang++ versions we support and test (g++-5 onwards and
clang++6 onwards) support C++14. However, due to a defect in the
original C++14 specification, solved in N4387 ([1]), compilation would
fail on g++-5 due to the use of std::map::emplace() with a non-copyable
value type. It turns out we can easily fix it by switching to the
explicit piecewise emplace() overload.
There is thus really nothing holding back the switch. Let's do it, and
update the coding style accordingly.
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
When a fatal error occurs the program aborts, and all the logger
provides is the location of the line that caused the error. Extend this
with a full backtrace to help debugging.
The backtrace is generated using the backtrace() call, a GNU extension
to the C library. It is available in glibc and uClibc but not in musl.
Test for availability of the function to condition compilation of the
backtrace printing. Implementing backtrace support with musl is an
exercise left to the reader if desired.
The LogOutput class is extended to support writing string messages
directly to the output. Strings written directly will be considered as
LogDebug messages when written to the Syslog.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Commit 965c5bf7fbf5 ("meson: Define _FORTIFY_SOURCE for optimised
builds") tried to define _FORTIFY_SOURCE for optimised builds with
clang, but updated the common_arguments after it was used. This resulted
in the _FORTIFY_SOURCE option not being applied. Fix it.
Fixes: 965c5bf7fbf5 ("meson: Define _FORTIFY_SOURCE for optimised builds")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
The 'tests' option enables compilation of tests. On Gentoo and Chrome
OS, the corresponding package USE flag is named 'test'. Rename the
option to 'test' to bring it in line.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
_FORTIFY_SOURCE adds useful checks during compilation. The option is
enabled by default by gcc on all non-optimised builds (as it requires
-O1 or higher). Enable it explicitly for clang.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Commit b817bcec6b53 ("libcamera: Auto generate version information")
causes the build to fail in the Chromium OS build environment, because
git update-index tries to take a lock (ie. write) in the git repo that
is outside of the build directory.
The solution is to simply skip git update-index if we are building in
the Chromium OS build environment, and this decision is made if the
build directory is not a subdirectory of the source directory.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|