diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-20 23:28:43 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-23 19:15:44 +0200 |
commit | 976e01d59beecb7c1eb79396e8ec1f8d066fa355 (patch) | |
tree | 9cfed406a01bddf57d0f677632ff78ce4ba4c8ee /src/qcam | |
parent | 787852a240ae00a5574e7af9341460cec92ce04a (diff) |
meson: Use subdir_done() to reduce indentation
Reduce the indentation in the gstreamer and qcam meson.build with
subdir_done(). This follows similar patterns in cam and v4l2.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam')
-rw-r--r-- | src/qcam/meson.build | 100 |
1 files changed, 51 insertions, 49 deletions
diff --git a/src/qcam/meson.build b/src/qcam/meson.build index 8f3d50dd..df4ca988 100644 --- a/src/qcam/meson.build +++ b/src/qcam/meson.build @@ -1,5 +1,16 @@ # SPDX-License-Identifier: CC0-1.0 +qt5 = import('qt5') +qt5_dep = dependency('qt5', + method : 'pkg-config', + modules : ['Core', 'Gui', 'Widgets'], + required : get_option('qcam'), + version : '>=5.4') + +if not qt5_dep.found() + subdir_done() +endif + qcam_sources = files([ '../cam/options.cpp', '../cam/stream_options.cpp', @@ -19,58 +30,49 @@ qcam_resources = files([ 'assets/feathericons/feathericons.qrc', ]) -qt5 = import('qt5') -qt5_dep = dependency('qt5', - method : 'pkg-config', - modules : ['Core', 'Gui', 'Widgets'], - required : get_option('qcam'), - version : '>=5.4') - -if qt5_dep.found() - qcam_deps = [ - libcamera_dep, - qt5_dep, - ] +qcam_deps = [ + libcamera_dep, + 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] - qcam_sources += files([ - 'dng_writer.cpp', - ]) - endif +tiff_dep = dependency('libtiff-4', required : false) +if tiff_dep.found() + qt5_cpp_args += ['-DHAVE_TIFF'] + qcam_deps += [tiff_dep] + qcam_sources += files([ + 'dng_writer.cpp', + ]) +endif - if cxx.has_header_symbol('QOpenGLWidget', 'QOpenGLWidget', - dependencies : qt5_dep, args : '-fPIC') - qcam_sources += files([ - 'viewfinder_gl.cpp', - ]) - qcam_moc_headers += files([ - 'viewfinder_gl.h', - ]) - qcam_resources += files([ - 'assets/shader/shaders.qrc' - ]) - endif +if cxx.has_header_symbol('QOpenGLWidget', 'QOpenGLWidget', + dependencies : qt5_dep, args : '-fPIC') + qcam_sources += files([ + 'viewfinder_gl.cpp', + ]) + qcam_moc_headers += files([ + 'viewfinder_gl.h', + ]) + qcam_resources += files([ + 'assets/shader/shaders.qrc' + ]) +endif - # gcc 9 introduced a deprecated-copy warning that is triggered by Qt until - # Qt 5.13. clang 10 introduced the same warning, but detects more issues - # that are not fixed in Qt yet. Disable the warning manually in both cases. - 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'] - endif +# gcc 9 introduced a deprecated-copy warning that is triggered by Qt until +# Qt 5.13. clang 10 introduced the same warning, but detects more issues +# that are not fixed in Qt yet. Disable the warning manually in both cases. +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'] +endif - resources = qt5.preprocess(moc_headers: qcam_moc_headers, - qresources : qcam_resources, - dependencies: qt5_dep) +resources = qt5.preprocess(moc_headers: qcam_moc_headers, + qresources : qcam_resources, + dependencies: qt5_dep) - qcam = executable('qcam', qcam_sources, resources, - install : true, - dependencies : qcam_deps, - cpp_args : qt5_cpp_args) -endif +qcam = executable('qcam', qcam_sources, resources, + install : true, + dependencies : qcam_deps, + cpp_args : qt5_cpp_args) |