meson: Fix coding style in meson.build files

Consistently go for 4 spaces indentation, and always put a space between
the colon in argument lists, as per the examples from the meson
documentation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2019-05-23 00:05:30 +03:00
parent 1f32abb995
commit 41adc3f8d3
9 changed files with 57 additions and 57 deletions

View file

@ -4,7 +4,7 @@ doc_install_dir = join_paths(get_option('datadir'), 'doc', 'libcamera-@0@'.forma
# Doxygen # Doxygen
# #
doxygen = find_program('doxygen', required: false) doxygen = find_program('doxygen', required : false)
if doxygen.found() if doxygen.found()
cdata = configuration_data() cdata = configuration_data()
@ -12,30 +12,30 @@ if doxygen.found()
cdata.set('TOP_SRCDIR', meson.source_root()) cdata.set('TOP_SRCDIR', meson.source_root())
cdata.set('TOP_BUILDDIR', meson.build_root()) cdata.set('TOP_BUILDDIR', meson.build_root())
doxyfile = configure_file(input: 'Doxyfile.in', doxyfile = configure_file(input : 'Doxyfile.in',
output: 'Doxyfile', output : 'Doxyfile',
configuration: cdata) configuration : cdata)
custom_target('doxygen', custom_target('doxygen',
input: [ input : [
doxyfile, doxyfile,
libcamera_api, libcamera_api,
libcamera_headers, libcamera_headers,
libcamera_sources, libcamera_sources,
], ],
output: 'api-html', output : 'api-html',
command: [doxygen, doxyfile], command : [doxygen, doxyfile],
install: true, install : true,
install_dir: doc_install_dir) install_dir : doc_install_dir)
endif endif
# #
# Sphinx # Sphinx
# #
sphinx = find_program('sphinx-build-3', required: false) sphinx = find_program('sphinx-build-3', required : false)
if not sphinx.found() if not sphinx.found()
sphinx = find_program('sphinx-build', required: false) sphinx = find_program('sphinx-build', required : false)
endif endif
if sphinx.found() if sphinx.found()
@ -48,10 +48,10 @@ if sphinx.found()
] ]
custom_target('documentation', custom_target('documentation',
command: [sphinx, '-q', '-W', '-b', 'html', meson.current_source_dir(), '@OUTPUT@'], command : [sphinx, '-q', '-W', '-b', 'html', meson.current_source_dir(), '@OUTPUT@'],
input: docs_sources, input : docs_sources,
output: 'html', output : 'html',
build_by_default: true, build_by_default : true,
install: true, install : true,
install_dir: doc_install_dir) install_dir : doc_install_dir)
endif endif

View file

@ -1,12 +1,12 @@
project('libcamera', 'c', 'cpp', project('libcamera', 'c', 'cpp',
meson_version: '>= 0.40', meson_version : '>= 0.40',
version : '0.1', version : '0.1',
default_options: [ default_options : [
'werror=true', 'werror=true',
'warning_level=2', 'warning_level=2',
'cpp_std=c++11', 'cpp_std=c++11',
], ],
license : 'LGPL 2.1+') license : 'LGPL 2.1+')
# TODO: Extract this from project.version. # TODO: Extract this from project.version.
# Ideally the version at Documentation/conf.py should be # Ideally the version at Documentation/conf.py should be
@ -16,7 +16,7 @@ api_version = '0.1'
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
config_h = configuration_data() config_h = configuration_data()
if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix: '#define _GNU_SOURCE') if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOURCE')
config_h.set('HAVE_SECURE_GETENV', 1) config_h.set('HAVE_SECURE_GETENV', 1)
endif endif
@ -28,8 +28,8 @@ common_arguments = [
c_arguments = common_arguments c_arguments = common_arguments
cpp_arguments = common_arguments cpp_arguments = common_arguments
add_project_arguments(c_arguments, language: 'c') add_project_arguments(c_arguments, language : 'c')
add_project_arguments(cpp_arguments, language: 'cpp') add_project_arguments(cpp_arguments, language : 'cpp')
libcamera_includes = include_directories('include') libcamera_includes = include_directories('include')
@ -41,14 +41,14 @@ subdir('utils')
# through configuration values. They are enabled by default. # through configuration values. They are enabled by default.
if get_option('documentation') if get_option('documentation')
subdir('Documentation') subdir('Documentation')
endif endif
if get_option('tests') if get_option('tests')
subdir('test') subdir('test')
endif endif
configure_file(output: 'config.h', configuration: config_h) configure_file(output : 'config.h', configuration : config_h)
pkg_mod = import('pkgconfig') pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : libcamera, pkg_mod.generate(libraries : libcamera,

View file

@ -51,7 +51,7 @@ includes = [
subdir('pipeline') subdir('pipeline')
libudev = dependency('libudev', required: false) libudev = dependency('libudev', required : false)
if libudev.found() if libudev.found()
config_h.set('HAVE_LIBUDEV', 1) config_h.set('HAVE_LIBUDEV', 1)

View file

@ -1,15 +1,15 @@
# Tests are listed in order of complexity. # Tests are listed in order of complexity.
# They are not alphabetically sorted. # They are not alphabetically sorted.
camera_tests = [ camera_tests = [
[ 'configuration_default', 'configuration_default.cpp' ], [ 'configuration_default', 'configuration_default.cpp' ],
[ 'configuration_set', 'configuration_set.cpp' ], [ 'configuration_set', 'configuration_set.cpp' ],
[ 'statemachine', 'statemachine.cpp' ], [ 'statemachine', 'statemachine.cpp' ],
[ 'capture', 'capture.cpp' ], [ 'capture', 'capture.cpp' ],
] ]
foreach t : camera_tests foreach t : camera_tests
exe = executable(t[0], [t[1], 'camera_test.cpp'], exe = executable(t[0], [t[1], 'camera_test.cpp'],
link_with : test_libraries, link_with : test_libraries,
include_directories : test_includes_internal) include_directories : test_includes_internal)
test(t[0], exe, suite: 'camera', is_parallel: false) test(t[0], exe, suite : 'camera', is_parallel : false)
endforeach endforeach

View file

@ -4,8 +4,8 @@ ipa_modules_sources = [
] ]
foreach m : ipa_modules_sources foreach m : ipa_modules_sources
shared_library(m, name_prefix: '', shared_library(m, name_prefix : '',
include_directories: test_includes_public) include_directories : test_includes_public)
endforeach endforeach
ipa_test = [ ipa_test = [
@ -17,5 +17,5 @@ foreach t : ipa_test
link_with : test_libraries, link_with : test_libraries,
include_directories : test_includes_internal) include_directories : test_includes_internal)
test(t[0], exe, suite: 'ipa', is_parallel: false) test(t[0], exe, suite : 'ipa', is_parallel : false)
endforeach endforeach

View file

@ -16,5 +16,5 @@ foreach t : media_device_tests
link_with : [test_libraries, lib_mdev_test], link_with : [test_libraries, lib_mdev_test],
include_directories : test_includes_internal) include_directories : test_includes_internal)
test(t[0], exe, suite: 'media_device', is_parallel: false) test(t[0], exe, suite : 'media_device', is_parallel : false)
endforeach endforeach

View file

@ -1,5 +1,5 @@
ipu3_test = [ ipu3_test = [
['ipu3_pipeline_test', 'ipu3_pipeline_test.cpp'], ['ipu3_pipeline_test', 'ipu3_pipeline_test.cpp'],
] ]
foreach t : ipu3_test foreach t : ipu3_test
@ -7,5 +7,5 @@ foreach t : ipu3_test
link_with : test_libraries, link_with : test_libraries,
include_directories : test_includes_internal) include_directories : test_includes_internal)
test(t[0], exe, suite: 'ipu3', is_parallel: false) test(t[0], exe, suite : 'ipu3', is_parallel : false)
endforeach endforeach

View file

@ -1,17 +1,17 @@
# Tests are listed in order of complexity. # Tests are listed in order of complexity.
# They are not alphabetically sorted. # They are not alphabetically sorted.
v4l2_device_tests = [ v4l2_device_tests = [
[ 'double_open', 'double_open.cpp' ], [ 'double_open', 'double_open.cpp' ],
[ 'formats', 'formats.cpp' ], [ 'formats', 'formats.cpp' ],
[ 'request_buffers', 'request_buffers.cpp' ], [ 'request_buffers', 'request_buffers.cpp' ],
[ 'stream_on_off', 'stream_on_off.cpp' ], [ 'stream_on_off', 'stream_on_off.cpp' ],
[ 'capture_async', 'capture_async.cpp' ], [ 'capture_async', 'capture_async.cpp' ],
[ 'buffer_sharing', 'buffer_sharing.cpp' ], [ 'buffer_sharing', 'buffer_sharing.cpp' ],
] ]
foreach t : v4l2_device_tests foreach t : v4l2_device_tests
exe = executable(t[0], [t[1], 'v4l2_device_test.cpp'], exe = executable(t[0], [t[1], 'v4l2_device_test.cpp'],
link_with : test_libraries, link_with : test_libraries,
include_directories : test_includes_internal) include_directories : test_includes_internal)
test(t[0], exe, suite: 'v4l2_device', is_parallel: false) test(t[0], exe, suite : 'v4l2_device', is_parallel : false)
endforeach endforeach

View file

@ -7,5 +7,5 @@ foreach t : v4l2_subdevice_tests
exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'], exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],
link_with : test_libraries, link_with : test_libraries,
include_directories : test_includes_internal) include_directories : test_includes_internal)
test(t[0], exe, suite: 'v4l2_subdevice', is_parallel: false) test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)
endforeach endforeach