meson: Make mpegts lib build when using subprojects
authorThibault Saunier <tsaunier@gnome.org>
Wed, 24 Aug 2016 12:41:08 +0000 (09:41 -0300)
committerThibault Saunier <tsaunier@gnome.org>
Thu, 25 Aug 2016 18:17:17 +0000 (15:17 -0300)
The headers passed as parametter are relative to the build dir
basically "../subproject/gst-plugins-bad/gst-libs/gst/mpegts/XXX.h"
but that does not match what is needed at build time when building as
subproject, also we always add current dir as include_dir so we are
safe including directly.

And link mpegtsdemux against the 'math' library as it is needed.

gst-libs/gst/mpegts/mpegts_enum.py
gst/mpegtsdemux/meson.build
meson.build

index 05efedbc4855db80666c6317b50a6a005778f78a..c0c234a867a85efb8ba175f0ab413add0acf0b60 100755 (executable)
@@ -5,7 +5,7 @@
 # make special characters such as \n go through all
 # backends is a fool's errand.
 
-import sys, os, shutil, subprocess
+import sys, os, subprocess
 
 cmd = []
 argn = 1
@@ -20,7 +20,7 @@ for arg in sys.argv[1:]:
 ofilename = sys.argv[argn]
 headers = sys.argv[argn + 1:]
 
-inc = '\n'.join(['#include"%s"' % i for i in headers])
+inc = '\n'.join(['#include"%s"' % os.path.basename(i) for i in headers])
 
 h_array = ['--fhead',
            "#ifndef __GST_MPEGTS_ENUM_TYPES_H__\n#define __GST_MPEGTS_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n",
index 202dba84ce48049b87997398828107ec3a5079df..4cd448c659f6f0458b0504fac4a57431e8dd346c 100644 (file)
@@ -12,7 +12,7 @@ gstmpegtsdemux = library('gstmpegtsdemux',
   c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
   include_directories : [configinc, libsinc],
   dependencies : [gstcodecparsers_dep, gstmpegts_dep, gsttag_dep,
-                 gstpbutils_dep, gstaudio_dep, gstbase_dep],
+                 gstpbutils_dep, gstaudio_dep, gstbase_dep, mathlib],
   install : true,
   install_dir : plugins_install_dir,
 )
index a79b9129b75fc616c5e92c4070fbcc9110a52d61..cb3bac8994e33ba279b6e2db580f75b78ab1a82d 100644 (file)
@@ -305,6 +305,8 @@ if x11_dep.found()
   cdata.set('HAVE_X11', 1)
 endif
 
+mathlib = cc.find_library('m', required : false)
+
 if host_machine.system() == 'windows'
   winsock2 = [cc.find_library('ws2_32')]
 else