build: use dependency for matrix.c
authorPekka Paalanen <pekka.paalanen@collabora.com>
Fri, 5 Apr 2019 10:50:43 +0000 (13:50 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.com>
Fri, 4 Oct 2019 12:55:55 +0000 (15:55 +0300)
matrix.c needs to be built differently for a test program vs. everything else,
so it cannot be in a helper lib. Instead, make a dependency object for it for
easy use which always gets all the paths correct automatically.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
clients/meson.build
libweston/meson.build
shared/meson.build
tests/meson.build

index ff6246db708e1169c439527d540551b9aad08864..135e54e700966beb579ac3a1d074e06e8f3c3ed7 100644 (file)
@@ -163,11 +163,8 @@ tools_enabled = get_option('tools')
 tools_list = [
        {
                'name': 'calibrator',
-               'sources': [
-                       'calibrator.c',
-                       '../shared/matrix.c',
-               ],
-               'deps': [ dep_toytoolkit ],
+               'sources': [ 'calibrator.c' ],
+               'deps': [ dep_toytoolkit, dep_matrix_c ],
        },
        {
                'name': 'debug',
@@ -202,11 +199,10 @@ tools_list = [
                'name': 'touch-calibrator',
                'sources': [
                        'touch-calibrator.c',
-                       '../shared/matrix.c',
                        weston_touch_calibration_client_protocol_h,
                        weston_touch_calibration_protocol_c,
                ],
-               'deps': [ dep_toytoolkit ],
+               'deps': [ dep_toytoolkit, dep_matrix_c ],
        },
 ]
 
index d8d3fc07a4ad2c2f26d7892b84e052bfcd61a45e..a10bf348c6dd79f48ffc847c4b66f8f0cf510401 100644 (file)
@@ -5,6 +5,7 @@ deps_libweston = [
        dep_libdl,
        dep_libdrm_headers,
        dep_xkbcommon,
+       dep_matrix_c
 ]
 srcs_libweston = [
        git_version_h,
@@ -31,7 +32,6 @@ srcs_libweston = [
        'weston-log-flight-rec.c',
        'weston-log.c',
        'zoom.c',
-       '../shared/matrix.c',
        linux_dmabuf_unstable_v1_protocol_c,
        linux_dmabuf_unstable_v1_server_protocol_h,
        linux_explicit_synchronization_unstable_v1_protocol_c,
index eb897c1009859b9407e4ff4ec554c43a49780b1d..081b57327d5c9067f9d139a8468356f9da059b09 100644 (file)
@@ -76,3 +76,9 @@ dep_lib_cairo_shared = declare_dependency(
        link_with: lib_cairo_shared,
        dependencies: deps_cairo_shared
 )
+
+dep_matrix_c = declare_dependency(
+       sources: 'matrix.c',
+       include_directories: public_inc,
+       dependencies: dep_libm
+)
index b1f6807c1f965dd80342e1c89c76387197b67f88..0b880d170d225437b1fc39580de2ccd638981634 100644 (file)
@@ -97,7 +97,7 @@ dep_zucmain = declare_dependency(
 
 tests_standalone = [
        ['config-parser', [], [ dep_zucmain ]],
-       ['matrix', [ '../shared/matrix.c' ], [ dep_libm, dep_libshared.partial_dependency(includes: true) ]],
+       ['matrix', [], [ dep_libm, dep_libshared.partial_dependency(includes: true), dep_matrix_c ]],
        ['string'],
        [ 'vertex-clip', [], [ dep_test_client, dep_vertex_clipping ]],
        ['timespec', [], [ dep_zucmain ]],