[libcamera-devel] [PATCH 1/2] meson: Fix coding style when declaring arrays
Kieran Bingham
kieran.bingham at ideasonboard.com
Thu Feb 11 16:40:28 CET 2021
Hi Laurent,
On 08/02/2021 22:20, Laurent Pinchart wrote:
> The meson.build files mix array declarations with and without a space
> after the opening and before the closing square bracket. The vast
> majority of cases don't use spaces, so standardize on that.
>
> While it it, fix indentation in a few places.
>
Looks good to me.
I'm surprised this wasn't done in
41adc3f8d39e meson: Fix coding style in meson.build files
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> include/libcamera/internal/meson.build | 4 ++--
> src/android/meson.build | 4 ++--
> src/gstreamer/meson.build | 2 +-
> src/ipa/ipu3/meson.build | 6 +++---
> src/ipa/raspberrypi/meson.build | 2 +-
> src/ipa/rkisp1/meson.build | 2 +-
> src/ipa/vimc/meson.build | 2 +-
> src/libcamera/meson.build | 4 ++--
> src/meson.build | 4 ++--
> src/qcam/meson.build | 8 ++++----
> src/v4l2/meson.build | 2 +-
> test/camera/meson.build | 10 +++++-----
> test/controls/meson.build | 8 ++++----
> test/ipc/meson.build | 2 +-
> test/process/meson.build | 2 +-
> test/serialization/meson.build | 2 +-
> test/stream/meson.build | 12 ++++++------
> test/v4l2_subdevice/meson.build | 4 ++--
> test/v4l2_videodevice/meson.build | 18 +++++++++---------
> 19 files changed, 49 insertions(+), 49 deletions(-)
>
> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build
> index e67a359fb865..a1071721967e 100644
> --- a/include/libcamera/internal/meson.build
> +++ b/include/libcamera/internal/meson.build
> @@ -4,9 +4,9 @@ subdir('tracepoints')
>
> libcamera_tracepoint_header = custom_target(
> 'tp_header',
> - input: [ 'tracepoints.h.in', tracepoint_files ],
> + input: ['tracepoints.h.in', tracepoint_files],
> output: 'tracepoints.h',
> - command: [ gen_tracepoints_header, '@OUTPUT@', '@INPUT@' ],
> + command: [gen_tracepoints_header, '@OUTPUT@', '@INPUT@'],
> )
>
> libcamera_internal_headers = files([
> diff --git a/src/android/meson.build b/src/android/meson.build
> index 95d0f420a5bc..f5567a1cd8eb 100644
> --- a/src/android/meson.build
> +++ b/src/android/meson.build
> @@ -32,9 +32,9 @@ if android_enabled
> libyuv_vars.append_link_args('-ljpeg')
> libyuv = cmake.subproject('libyuv', options : libyuv_vars)
> libyuv_dep = libyuv.dependency('yuv')
> - endif
> + endif
>
> - android_deps += [ libyuv_dep, ]
> + android_deps += [libyuv_dep]
> endif
>
> android_hal_sources = files([
> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build
> index c9f0c13d969d..9e93ffac28b6 100644
> --- a/src/gstreamer/meson.build
> +++ b/src/gstreamer/meson.build
> @@ -29,7 +29,7 @@ if glib_dep.found() and gstvideo_dep.found() and gstallocator_dep.found()
> # complain about the ones we are not using. Silence the -Wunused-function
> # warning in that case.
> if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0')
> - libcamera_gst_cpp_args += [ '-Wno-unused-function' ]
> + libcamera_gst_cpp_args += ['-Wno-unused-function']
> endif
>
> libcamera_gst = shared_library('gstlibcamera',
> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build
> index 444c82453eac..d31594fcb213 100644
> --- a/src/ipa/ipu3/meson.build
> +++ b/src/ipa/ipu3/meson.build
> @@ -5,8 +5,8 @@ ipa_name = 'ipa_ipu3'
> mod = shared_module(ipa_name,
> 'ipu3.cpp',
> name_prefix : '',
> - include_directories : [ ipa_includes, libipa_includes ],
> - dependencies : [ libatomic, libcamera_dep ],
> + include_directories : [ipa_includes, libipa_includes],
> + dependencies : [libatomic, libcamera_dep],
> link_with : libipa,
> install : true,
> install_dir : ipa_install_dir)
> @@ -15,7 +15,7 @@ if ipa_sign_module
> custom_target(ipa_name + '.so.sign',
> input : mod,
> output : ipa_name + '.so.sign',
> - command : [ ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@' ],
> + command : [ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@'],
> install : false,
> build_by_default : true)
> endif
> diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build
> index 9445cd097df5..9e9ea80b93ad 100644
> --- a/src/ipa/raspberrypi/meson.build
> +++ b/src/ipa/raspberrypi/meson.build
> @@ -54,7 +54,7 @@ if ipa_sign_module
> custom_target(ipa_name + '.so.sign',
> input : mod,
> output : ipa_name + '.so.sign',
> - command : [ ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@' ],
> + command : [ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@'],
> install : false,
> build_by_default : true)
> endif
> diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build
> index ed9a6b6b8ec8..95eb5393f76f 100644
> --- a/src/ipa/rkisp1/meson.build
> +++ b/src/ipa/rkisp1/meson.build
> @@ -15,7 +15,7 @@ if ipa_sign_module
> custom_target(ipa_name + '.so.sign',
> input : mod,
> output : ipa_name + '.so.sign',
> - command : [ ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@' ],
> + command : [ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@'],
> install : false,
> build_by_default : true)
> endif
> diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build
> index 8c9df854007a..b1544c289932 100644
> --- a/src/ipa/vimc/meson.build
> +++ b/src/ipa/vimc/meson.build
> @@ -15,7 +15,7 @@ if ipa_sign_module
> custom_target(ipa_name + '.so.sign',
> input : mod,
> output : ipa_name + '.so.sign',
> - command : [ ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@' ],
> + command : [ipa_sign, ipa_priv_key, '@INPUT@', '@OUTPUT@'],
> install : false,
> build_by_default : true)
> endif
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 5a4bf0d7ba4f..2b1850897aa4 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -111,9 +111,9 @@ libcamera_sources += version_cpp
>
> if ipa_sign_module
> ipa_pub_key_cpp = custom_target('ipa_pub_key_cpp',
> - input : [ ipa_priv_key, 'ipa_pub_key.cpp.in' ],
> + input : [ipa_priv_key, 'ipa_pub_key.cpp.in'],
> output : 'ipa_pub_key.cpp',
> - command : [ gen_ipa_pub_key, '@INPUT@', '@OUTPUT@' ])
> + command : [gen_ipa_pub_key, '@INPUT@', '@OUTPUT@'])
>
> libcamera_sources += ipa_pub_key_cpp
> endif
> diff --git a/src/meson.build b/src/meson.build
> index 4b75f05878bc..0b26ca70f7de 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -3,8 +3,8 @@
> openssl = find_program('openssl', required : true)
> if openssl.found()
> ipa_priv_key = custom_target('ipa-priv-key',
> - output : [ 'ipa-priv-key.pem' ],
> - command : [ gen_ipa_priv_key, '@OUTPUT@' ])
> + output : ['ipa-priv-key.pem'],
> + command : [gen_ipa_priv_key, '@OUTPUT@'])
> config_h.set('HAVE_IPA_PUBKEY', 1)
> ipa_sign_module = true
> else
> diff --git a/src/qcam/meson.build b/src/qcam/meson.build
> index ebcd5ca010cf..8f3d50dd71c5 100644
> --- a/src/qcam/meson.build
> +++ b/src/qcam/meson.build
> @@ -32,12 +32,12 @@ if qt5_dep.found()
> qt5_dep,
> ]
>
> - qt5_cpp_args = [ '-DQT_NO_KEYWORDS' ]
> + qt5_cpp_args = ['-DQT_NO_KEYWORDS']
>
> tiff_dep = dependency('libtiff-4', required : false)
> if tiff_dep.found()
> - qt5_cpp_args += [ '-DHAVE_TIFF' ]
> - qcam_deps += [ tiff_dep ]
> + qt5_cpp_args += ['-DHAVE_TIFF']
> + qcam_deps += [tiff_dep]
> qcam_sources += files([
> 'dng_writer.cpp',
> ])
> @@ -62,7 +62,7 @@ if qt5_dep.found()
> if ((cc.get_id() == 'gcc' and cc.version().version_compare('>=9.0') and
> qt5_dep.version().version_compare('<5.13')) or
> (cc.get_id() == 'clang' and cc.version().version_compare('>=10.0')))
> - qt5_cpp_args += [ '-Wno-deprecated-copy' ]
> + qt5_cpp_args += ['-Wno-deprecated-copy']
> endif
>
> resources = qt5.preprocess(moc_headers: qcam_moc_headers,
> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
> index dbe6a424b10e..c8b794247560 100644
> --- a/src/v4l2/meson.build
> +++ b/src/v4l2/meson.build
> @@ -28,5 +28,5 @@ v4l2_compat = shared_library('v4l2-compat',
> v4l2_compat_sources,
> name_prefix : '',
> install : true,
> - dependencies : [ libcamera_dep, libdl ],
> + dependencies : [libcamera_dep, libdl],
> cpp_args : v4l2_compat_cpp_args)
> diff --git a/test/camera/meson.build b/test/camera/meson.build
> index 0395e7ddc7a4..9cb95affffab 100644
> --- a/test/camera/meson.build
> +++ b/test/camera/meson.build
> @@ -3,11 +3,11 @@
> # Tests are listed in order of complexity.
> # They are not alphabetically sorted.
> camera_tests = [
> - [ 'configuration_default', 'configuration_default.cpp' ],
> - [ 'configuration_set', 'configuration_set.cpp' ],
> - [ 'buffer_import', 'buffer_import.cpp' ],
> - [ 'statemachine', 'statemachine.cpp' ],
> - [ 'capture', 'capture.cpp' ],
> + ['configuration_default', 'configuration_default.cpp'],
> + ['configuration_set', 'configuration_set.cpp'],
> + ['buffer_import', 'buffer_import.cpp'],
> + ['statemachine', 'statemachine.cpp'],
> + ['capture', 'capture.cpp'],
> ]
>
> foreach t : camera_tests
> diff --git a/test/controls/meson.build b/test/controls/meson.build
> index 545fb03b16c6..188c96da3336 100644
> --- a/test/controls/meson.build
> +++ b/test/controls/meson.build
> @@ -1,10 +1,10 @@
> # SPDX-License-Identifier: CC0-1.0
>
> control_tests = [
> - [ 'control_info', 'control_info.cpp' ],
> - [ 'control_info_map', 'control_info_map.cpp' ],
> - [ 'control_list', 'control_list.cpp' ],
> - [ 'control_value', 'control_value.cpp' ],
> + ['control_info', 'control_info.cpp'],
> + ['control_info_map', 'control_info_map.cpp'],
> + ['control_list', 'control_list.cpp'],
> + ['control_value', 'control_value.cpp'],
> ]
>
> foreach t : control_tests
> diff --git a/test/ipc/meson.build b/test/ipc/meson.build
> index 650df1d63444..9f413ff68efc 100644
> --- a/test/ipc/meson.build
> +++ b/test/ipc/meson.build
> @@ -1,7 +1,7 @@
> # SPDX-License-Identifier: CC0-1.0
>
> ipc_tests = [
> - [ 'unixsocket', 'unixsocket.cpp' ],
> + ['unixsocket', 'unixsocket.cpp'],
> ]
>
> foreach t : ipc_tests
> diff --git a/test/process/meson.build b/test/process/meson.build
> index c215fa7e6c12..d2272d509db3 100644
> --- a/test/process/meson.build
> +++ b/test/process/meson.build
> @@ -1,7 +1,7 @@
> # SPDX-License-Identifier: CC0-1.0
>
> process_tests = [
> - [ 'process_test', 'process_test.cpp' ],
> + ['process_test', 'process_test.cpp'],
> ]
>
> foreach t : process_tests
> diff --git a/test/serialization/meson.build b/test/serialization/meson.build
> index a9d9cbcb7d80..6fc54f6b6586 100644
> --- a/test/serialization/meson.build
> +++ b/test/serialization/meson.build
> @@ -1,7 +1,7 @@
> # SPDX-License-Identifier: CC0-1.0
>
> serialization_tests = [
> - [ 'control_serialization', 'control_serialization.cpp' ],
> + ['control_serialization', 'control_serialization.cpp'],
> ]
>
> foreach t : serialization_tests
> diff --git a/test/stream/meson.build b/test/stream/meson.build
> index 2b9b29a9143b..5d3ef5881b44 100644
> --- a/test/stream/meson.build
> +++ b/test/stream/meson.build
> @@ -1,13 +1,13 @@
> # SPDX-License-Identifier: CC0-1.0
>
> stream_tests = [
> - [ 'stream_formats', 'stream_formats.cpp' ],
> + ['stream_formats', 'stream_formats.cpp'],
> ]
>
> foreach t : stream_tests
> - exe = executable(t[0], t[1],
> - dependencies : libcamera_dep,
> - link_with : test_libraries,
> - include_directories : test_includes_internal)
> - test(t[0], exe, suite: 'stream')
> + exe = executable(t[0], t[1],
> + dependencies : libcamera_dep,
> + link_with : test_libraries,
> + include_directories : test_includes_internal)
> + test(t[0], exe, suite: 'stream')
> endforeach
> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build
> index 5f0882ca9772..40d39766af9b 100644
> --- a/test/v4l2_subdevice/meson.build
> +++ b/test/v4l2_subdevice/meson.build
> @@ -1,8 +1,8 @@
> # SPDX-License-Identifier: CC0-1.0
>
> v4l2_subdevice_tests = [
> - [ 'list_formats', 'list_formats.cpp'],
> - [ 'test_formats', 'test_formats.cpp'],
> + ['list_formats', 'list_formats.cpp'],
> + ['test_formats', 'test_formats.cpp'],
> ]
>
> foreach t : v4l2_subdevice_tests
> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build
> index b4bb30908027..e733518c0185 100644
> --- a/test/v4l2_videodevice/meson.build
> +++ b/test/v4l2_videodevice/meson.build
> @@ -3,15 +3,15 @@
> # Tests are listed in order of complexity.
> # They are not alphabetically sorted.
> v4l2_videodevice_tests = [
> - [ 'double_open', 'double_open.cpp' ],
> - [ 'controls', 'controls.cpp' ],
> - [ 'formats', 'formats.cpp' ],
> - [ 'request_buffers', 'request_buffers.cpp' ],
> - [ 'buffer_cache', 'buffer_cache.cpp' ],
> - [ 'stream_on_off', 'stream_on_off.cpp' ],
> - [ 'capture_async', 'capture_async.cpp' ],
> - [ 'buffer_sharing', 'buffer_sharing.cpp' ],
> - [ 'v4l2_m2mdevice', 'v4l2_m2mdevice.cpp' ],
> + ['double_open', 'double_open.cpp'],
> + ['controls', 'controls.cpp'],
> + ['formats', 'formats.cpp'],
> + ['request_buffers', 'request_buffers.cpp'],
> + ['buffer_cache', 'buffer_cache.cpp'],
> + ['stream_on_off', 'stream_on_off.cpp'],
> + ['capture_async', 'capture_async.cpp'],
> + ['buffer_sharing', 'buffer_sharing.cpp'],
> + ['v4l2_m2mdevice', 'v4l2_m2mdevice.cpp'],
> ]
>
> foreach t : v4l2_videodevice_tests
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list