[totem/wip/inigomartinez/meson-improve: 7/14] build: Improve gst helpers build



commit c287a176ab555643fd658424d68d580d9494e024
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Fri Feb 16 13:15:32 2018 +0100

    build: Improve gst helpers build
    
    Totem builds three static helper libraries that are related to
    gstreamer. The build commands create different variables for
    holding their library dependencies which are not necessary.
    
    The meson internal dependencies created to use those static
    libraries in other targets have also been improved by including
    those libraries which are needed.

 meson.build             |    1 +
 src/backend/meson.build |   13 ++--------
 src/gst/meson.build     |   56 ++++++++++++++++++++--------------------------
 src/meson.build         |   12 ++-------
 4 files changed, 31 insertions(+), 51 deletions(-)
---
diff --git a/meson.build b/meson.build
index d8c6f1e..21882fa 100644
--- a/meson.build
+++ b/meson.build
@@ -120,6 +120,7 @@ grilo_req_version = '>= 0.3.0'
 peas_req_version = '>= 1.1.0'
 totem_plparser_req_version = '>= 3.10.1'
 
+gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
 glib_dep =  dependency('glib-2.0', version: glib_req_version)
 gobject_dep =  dependency('gobject-2.0', version: glib_req_version)
 gio_dep = dependency('gio-2.0', version: '>= 2.43.4')
diff --git a/src/backend/meson.build b/src/backend/meson.build
index ca0fda9..c7850f0 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -66,11 +66,6 @@ libbacon_gen_sources += gnome.mkenums(
   vtail: '      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static ("@EnumName@", values);\n  
}\n  return etype;\n}\n'
 )
 
-libbacon_video_widget_incs = [
-  top_inc,
-  gst_inc
-]
-
 libbacon_video_widget_deps = [
   gst_dep,
   dependency('gstreamer-base-1.0', version: gst_req_version),
@@ -84,9 +79,7 @@ libbacon_video_widget_deps = [
   dependency('cairo', version: '>= 1.14.0'),
   dependency('gsettings-desktop-schemas'),
   m_dep,
-  libtotem_gst_helpers_dep,
-  libtotem_gst_pixbuf_helpers_dep,
-  libtotem_time_helpers_dep
+  libtotem_gst_helpers_dep
 ]
 
 libbacon_video_widget_cflags = common_flags + warn_flags + [
@@ -100,7 +93,7 @@ endif
 libbacon_video_widget = static_library(
   'baconvideowidget',
   sources: sources + libbacon_gen_sources,
-  include_directories: libbacon_video_widget_incs,
+  include_directories: top_inc,
   dependencies: libbacon_video_widget_deps,
   c_args: libbacon_video_widget_cflags
 )
@@ -118,7 +111,7 @@ if enable_easy_codec_installation
   executable(
     backend_test,
     backend_test + '.c',
-    include_directories: libbacon_video_widget_incs,
+    include_directories: top_inc,
     dependencies: libbacon_video_widget_dep,
     c_args: libbacon_video_widget_cflags + [
       '-DLOGO_PATH="@0@"'.format(join_paths(totem_pkgdatadir, meson.project_name(), 'totem_logo.png')),
diff --git a/src/gst/meson.build b/src/gst/meson.build
index 209fb6f..abccaeb 100644
--- a/src/gst/meson.build
+++ b/src/gst/meson.build
@@ -1,38 +1,18 @@
-gst_inc = include_directories('.')
-
-libtotem_gst_helpers_deps = [
-  gst_dep,
-  gst_tag_dep,
-]
-
 libtotem_gst_helpers = static_library(
   'totemgsthelpers',
   sources: 'totem-gst-helpers.c',
-  dependencies: libtotem_gst_helpers_deps
+  dependencies: gst_dep
 )
 
-libtotem_gst_helpers_dep = declare_dependency(
-  link_with: libtotem_gst_helpers,
-  include_directories: gst_inc,
-  dependencies: libtotem_gst_helpers_deps
-)
-
-libtotem_gst_pixbuf_helpers_deps = [
-  dependency('gdk-pixbuf-2.0'),
-  gst_tag_dep,
-  gst_video_dep
+deps = [
+  gdk_pixbuf_dep,
+  gst_tag_dep
 ]
 
 libtotem_gst_pixbuf_helpers = static_library(
   'totemgstpixbufhelpers',
   sources: 'totem-gst-pixbuf-helpers.c',
-  dependencies: libtotem_gst_pixbuf_helpers_deps
-)
-
-libtotem_gst_pixbuf_helpers_dep = declare_dependency(
-  link_with: libtotem_gst_pixbuf_helpers,
-  include_directories: gst_inc,
-  dependencies: libtotem_gst_pixbuf_helpers_deps
+  dependencies: deps
 )
 
 libtotem_time_helpers = static_library(
@@ -42,19 +22,31 @@ libtotem_time_helpers = static_library(
 )
 
 libtotem_time_helpers_dep = declare_dependency(
-  link_with: libtotem_time_helpers,
-  include_directories: gst_inc,
-  dependencies: glib_dep
+  include_directories: include_directories('.'),
+  dependencies: glib_dep,
+  link_with: libtotem_time_helpers
+)
+
+libtotem_gst_helpers_dep = declare_dependency(
+  dependencies: [
+    gdk_pixbuf_dep,
+    gst_tag_dep,
+    libtotem_time_helpers_dep
+  ],
+  link_with: [
+    libtotem_gst_helpers,
+    libtotem_gst_pixbuf_helpers
+  ]
 )
 
-gst_test = 'test-time'
+test_unit = 'test-time'
 
 exe = executable(
-  gst_test,
-  gst_test + '.c',
+  test_unit,
+  test_unit + '.c',
   include_directories: top_inc,
   dependencies: glib_dep,
   link_with: libtotem_time_helpers
 )
 
-test(gst_test, exe)
+test(test_unit, exe)
diff --git a/src/meson.build b/src/meson.build
index 7b552a5..c6e2445 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -98,9 +98,7 @@ libtotem_player_sources = files(
   'totem-time-label.c'
 )
 
-libtotem_player_deps = totem_common_deps + [
-  libtotem_time_helpers_dep
-]
+libtotem_player_deps = totem_common_deps + [libtotem_time_helpers_dep]
 
 libtotem_player = static_library(
   'totem_player',
@@ -213,9 +211,7 @@ totem_video_thumbnailer_deps = [
   gst_tag_dep,
   gst_video_dep,
   m_dep,
-  libtotem_gst_helpers_dep,
-  libtotem_gst_pixbuf_helpers_dep,
-  libtotem_time_helpers_dep
+  libtotem_gst_helpers_dep
 ]
 
 executable(
@@ -240,9 +236,7 @@ totem_gallery_thumbnailer_deps = [
   gst_tag_dep,
   gst_video_dep,
   m_dep,
-  libtotem_gst_helpers_dep,
-  libtotem_gst_pixbuf_helpers_dep,
-  libtotem_time_helpers_dep
+  libtotem_gst_helpers_dep
 ]
 
 executable(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]