[libcamera-devel] [PATCH 2/2] libcamera: Use get_option('includedir') instead of raw 'include'

Kieran Bingham kieran.bingham at ideasonboard.com
Tue May 11 12:56:32 CEST 2021


Hi Umang,

On 08/05/2021 01:06, Laurent Pinchart wrote:
> Hi Umang,
> 
> Thank you for the patch.
> 
> On Fri, May 07, 2021 at 11:28:41AM +0530, Umang Jain wrote:
>> In most cases, file paths in meson files start with get_option().
>> To maintain a consistent theme, use meson's get_option('includedir')
>> universal option over raw 'include'. This option is defaulted to
>> 'include' string value, hence this commit does not introduce any
>> functional changes.
>>

Ah, yes this is a beneficial change, (even if it doesn't functionally
change the current default output)

I wonder if merging "get_option('includedir') / include_dir)" into a
single variable as it's used 4 times in the same file makes sense, but
this already is fine, so I'll merge these too (assuming all tests still
pass etc).

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

>> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> 
>> ---
>>  include/libcamera/meson.build | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
>> index 4a5b915e..086c958b 100644
>> --- a/include/libcamera/meson.build
>> +++ b/include/libcamera/meson.build
>> @@ -48,7 +48,7 @@ foreach header : control_source_files
>>                                       output : header + '.h',
>>                                       command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@'],
>>                                       install : true,
>> -                                     install_dir : 'include' / include_dir)
>> +                                     install_dir : get_option('includedir') / include_dir)
>>  endforeach
>>  
>>  libcamera_public_headers += control_headers
>> @@ -63,7 +63,7 @@ formats_h = custom_target('formats_h',
>>                            output : 'formats.h',
>>                            command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],
>>                            install : true,
>> -                          install_dir : 'include' / include_dir)
>> +                          install_dir : get_option('includedir') / include_dir)
>>  libcamera_public_headers += formats_h
>>  
>>  # libcamera.h
>> @@ -72,7 +72,7 @@ libcamera_h = custom_target('gen-header',
>>                              output : 'libcamera.h',
>>                              command : [gen_header, meson.current_source_dir(), '@OUTPUT@'],
>>                              install : true,
>> -                            install_dir : 'include' / include_dir)
>> +                            install_dir : get_option('includedir') / include_dir)
>>  
>>  libcamera_public_headers += libcamera_h
>>  
>> @@ -86,4 +86,4 @@ libcamera_version_config.set('LIBCAMERA_VERSION_PATCH', version[2])
>>  configure_file(input : 'version.h.in',
>>                 output : 'version.h',
>>                 configuration : libcamera_version_config,
>> -               install_dir : 'include' / include_dir)
>> +               install_dir : get_option('includedir') / include_dir)
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list