msdk: use a dummy.cpp file to force c++ linking
authorScott D Phillips <scott.d.phillips@intel.com>
Fri, 21 Apr 2017 03:18:30 +0000 (20:18 -0700)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 4 May 2017 23:12:17 +0000 (00:12 +0100)
Add a dummy.cpp file to force c++ linking as required by libmfx.a.
I'm certain that the meson build worked for me in the past, but I
have no idea how it could have, looking at it now.

https://bugzilla.gnome.org/show_bug.cgi?id=781561

sys/msdk/dummy.cpp [new file with mode: 0644]
sys/msdk/meson.build

diff --git a/sys/msdk/dummy.cpp b/sys/msdk/dummy.cpp
new file mode 100644 (file)
index 0000000..e82fb94
--- /dev/null
@@ -0,0 +1,3 @@
+/* This file exists to force C++ linking of the msdk plugin in the meson build,
+ * as required by libmfx.a. It can be removed when we depend on a version of
+ * meson which has a fix for https://github.com/mesonbuild/meson/issues/1653 */
index 0e8f9c7a021fc0dd7770d32f95338a5e914a7a86..e8c23a0438c4f4d1e51ebbf6a44262f8e2f95375 100644 (file)
@@ -11,6 +11,10 @@ msdk_sources = [
   'gstmsdkmpeg2enc.c',
   'gstmsdkvp8enc.c',
   'msdk.c',
+  'dummy.cpp', # This forces C++ linking of gstmsdk, which is
+               # required by libmfx.a. This can be removed when we
+               # depend on a version of meson that has a fix for
+               # https://github.com/mesonbuild/meson/issues/1653
 ]
 
 if host_machine.system() == 'windows'
@@ -25,7 +29,7 @@ msdk_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELME
 if msdk_root != ''
   msdk_libdir = [msdk_root + '/lib/lin_x64', msdk_root + '/lib/x64']
   msdk_incdir = include_directories(msdk_root + '/include')
-  msdk_lib = cc.find_library('mfx', dirs: msdk_libdir, required: false)
+  msdk_lib = cxx.find_library('mfx', dirs: msdk_libdir, required: false)
   if host_machine.system() == 'windows'
     legacy_stdio_dep = cc.find_library('legacy_stdio_definitions', required: false)
     d3d11_dep = cc.find_library('d3d11', required: false)