[libcamera-devel] [PATCH 2/2] libcamera: Use compile optimisation by default

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Apr 29 14:37:55 CEST 2019


Hi Laurent,

On 29/04/2019 00:12, Laurent Pinchart wrote:
> Set the compiler optimisation level to 2 by default.
> 

Isn't this handled already by the buildtype?

buildtype {plain, debug, debugoptimized, release, minsize, custom}

The default buildtype is 'debug', which I would expect to have an
optimization level of '0' or 'g' to make debugging in GDB easier.


Looking at https://mesonbuild.com/Running-Meson.html, it states that the
buildtype has the following effects:

========================================================================
You can specify a different type of build with the --buildtype command
line argument. It can have one of the following values.

value	 	meaning

plain		no extra build flags are used, even for compiler
		warnings, useful for distro packagers and other cases
		where you need to specify all arguments by yourself

debug		debug info is generated but the result is not optimized,
		this is the default

debugoptimized	debug info is generated and the code is optimized (on
		most compilers this means -g -O2)

release		full optimization, no debug info
========================================================================

So I think this patch is unnecessary.

--
Regards

Kieran


> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meson.build b/meson.build
> index d272ff33b100..a11a1e4c238e 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -5,6 +5,7 @@ project('libcamera', 'c', 'cpp',
>      'werror=true',
>      'warning_level=2',
>      'cpp_std=c++11',
> +    'optimization=2',
>    ],
>    license : 'LGPL 2.1+')
>  
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list