From 3fac104158fcbdd7d6d7ffb34e5db77f1f9ebeb5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 23 May 2019 00:14:19 +0300 Subject: meson: Create and use a dependency for libcamera and its headers Instead of manually adding the libcamera library and include path to every target that requires it, declare a dependency that groups the headers as source, the library and the include path, and use it through the project. This simplifies handling of the dependency. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- test/camera/meson.build | 1 + test/ipa/meson.build | 2 ++ test/libtest/meson.build | 6 +++--- test/media_device/meson.build | 2 ++ test/meson.build | 2 ++ test/pipeline/ipu3/meson.build | 1 + test/v4l2_device/meson.build | 1 + test/v4l2_subdevice/meson.build | 1 + 8 files changed, 13 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/camera/meson.build b/test/camera/meson.build index b01e7e02..35e97ce5 100644 --- a/test/camera/meson.build +++ b/test/camera/meson.build @@ -9,6 +9,7 @@ camera_tests = [ foreach t : camera_tests exe = executable(t[0], [t[1], 'camera_test.cpp'], + dependencies : libcamera_dep, link_with : test_libraries, include_directories : test_includes_internal) test(t[0], exe, suite : 'camera', is_parallel : false) diff --git a/test/ipa/meson.build b/test/ipa/meson.build index 53015e38..ecde313c 100644 --- a/test/ipa/meson.build +++ b/test/ipa/meson.build @@ -5,6 +5,7 @@ ipa_modules_sources = [ foreach m : ipa_modules_sources shared_library(m, name_prefix : '', + dependencies : libcamera_dep, include_directories : test_includes_public) endforeach @@ -14,6 +15,7 @@ ipa_test = [ foreach t : ipa_test exe = executable(t[0], t[1], + dependencies : libcamera_dep, link_with : test_libraries, include_directories : test_includes_internal) diff --git a/test/libtest/meson.build b/test/libtest/meson.build index e0893b70..ca762b44 100644 --- a/test/libtest/meson.build +++ b/test/libtest/meson.build @@ -2,15 +2,15 @@ libtest_sources = files([ 'test.cpp', ]) -libtest = static_library('libtest', libtest_sources) +libtest = static_library('libtest', libtest_sources, + dependencies : libcamera_dep) libtest_includes = include_directories('.') -test_libraries = [libcamera, libtest] +test_libraries = [libtest] test_includes_public = [ libtest_includes, - libcamera_includes, ] test_includes_internal = [ diff --git a/test/media_device/meson.build b/test/media_device/meson.build index 124f454e..6a0e4684 100644 --- a/test/media_device/meson.build +++ b/test/media_device/meson.build @@ -9,10 +9,12 @@ media_device_tests = [ ] lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources, + dependencies : libcamera_dep, include_directories : test_includes_internal) foreach t : media_device_tests exe = executable(t[0], t[1], + dependencies : libcamera_dep, link_with : [test_libraries, lib_mdev_test], include_directories : test_includes_internal) diff --git a/test/meson.build b/test/meson.build index ef413679..609aeab8 100644 --- a/test/meson.build +++ b/test/meson.build @@ -21,6 +21,7 @@ internal_tests = [ foreach t : public_tests exe = executable(t[0], t[1], + dependencies : libcamera_dep, link_with : test_libraries, include_directories : test_includes_public) @@ -29,6 +30,7 @@ endforeach foreach t : internal_tests exe = executable(t[0], t[1], + dependencies : libcamera_dep, link_with : test_libraries, include_directories : test_includes_internal) diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build index 87074588..d02927c9 100644 --- a/test/pipeline/ipu3/meson.build +++ b/test/pipeline/ipu3/meson.build @@ -4,6 +4,7 @@ ipu3_test = [ foreach t : ipu3_test exe = executable(t[0], t[1], + dependencies : libcamera_dep, link_with : test_libraries, include_directories : test_includes_internal) diff --git a/test/v4l2_device/meson.build b/test/v4l2_device/meson.build index 32556cf5..de540b1b 100644 --- a/test/v4l2_device/meson.build +++ b/test/v4l2_device/meson.build @@ -11,6 +11,7 @@ v4l2_device_tests = [ foreach t : v4l2_device_tests exe = executable(t[0], [t[1], 'v4l2_device_test.cpp'], + dependencies : libcamera_dep, link_with : test_libraries, include_directories : test_includes_internal) test(t[0], exe, suite : 'v4l2_device', is_parallel : false) diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build index 282f6e23..0521984b 100644 --- a/test/v4l2_subdevice/meson.build +++ b/test/v4l2_subdevice/meson.build @@ -5,6 +5,7 @@ v4l2_subdevice_tests = [ foreach t : v4l2_subdevice_tests exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'], + dependencies : libcamera_dep, link_with : test_libraries, include_directories : test_includes_internal) test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false) -- cgit v1.2.1