meson: Fix plugin symbol export for C++ sources/plugins
authorJan Schmidt <jan@centricular.com>
Fri, 6 Sep 2019 09:13:46 +0000 (19:13 +1000)
committerJan Schmidt <thaytan@noraisin.net>
Tue, 12 Nov 2019 13:00:42 +0000 (13:00 +0000)
The symbol visibility=hidden flag was only being applied to C
compilation, so plugins implemented in C++ would leak extra symbols
than the 2 _get_desc() and _register().

That also showed that the gst-libs opencv C++ lib was not marking
symbols for export correctly because the BUILDING_GST_OPENCV define
wasn't in the C++ args, so fix that too.

gst-libs/gst/opencv/meson.build
meson.build

index 8dc2ad9..f659d57 100644 (file)
@@ -17,6 +17,7 @@ if opencv_dep.found()
   gstopencv = library('gstopencv-' + api_version,
     opencv_sources,
     c_args : gst_plugins_bad_args + ['-DBUILDING_GST_OPENCV'],
+    cpp_args : gst_plugins_bad_args + ['-DBUILDING_GST_OPENCV'],
     include_directories : [configinc, libsinc],
     version : libversion,
     soversion : soversion,
index 7b3314b..6eabbf1 100644 (file)
@@ -70,6 +70,7 @@ if cc.get_id() == 'msvc'
   export_define = '__declspec(dllexport) extern'
 elif cc.has_argument('-fvisibility=hidden')
   add_project_arguments('-fvisibility=hidden', language: 'c')
+  add_project_arguments('-fvisibility=hidden', language: 'cpp')
   export_define = 'extern __attribute__ ((visibility ("default")))'
 else
   export_define = 'extern'