Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Meson build fail: Broken meson.build MediaSDK detection #148

Open
eero-t opened this issue Jan 7, 2019 · 1 comment
Open

Meson build fail: Broken meson.build MediaSDK detection #148

eero-t opened this issue Jan 7, 2019 · 1 comment

Comments

@eero-t
Copy link

eero-t commented Jan 7, 2019

Setup:

  • Ubuntu 18.04
  • Latest Open Source MediaSDK built from Git
  • Git version of gstreamer-media-SDK

Problem:

This is because:

  • find_library() adds weird/non-existing extra "lin_x64" path to MFX_HOME path
  • Although MFX_HOME is given, compiler doesn't find mfx include files (meson.build doesn't add missing "/mfx/" after MFX_HOME)

Just removing the MFX_HOME weirdness and using standard pkg-config stuff instead makes things work:

--- a/meson.build
+++ b/meson.build
@@ -25,19 +25,15 @@ configure_file (input: 'version.h.in',
 
 mfx_sources = []
 mfx_c_args = []
-mfx_deps = []
 
 mfx_c_args += ['-std=gnu99', '-fPIE', '-fPIC']
 
 # Check the Media SDK
-mfx_home = get_option ('MFX_HOME')
+mfx_deps = [dependency('mfx')]
 
-mfx_inc = include_directories(['.', 'gst/mfx', 'gst-libs/mfx', 'parsers', '@0@/include'.format(mfx_home)])
+mfx_inc = include_directories(['.', 'gst/mfx', 'gst-libs/mfx', 'parsers'])
 
 compiler = meson.get_compiler('c')
-libmfx = compiler.find_library('mfx', dirs: '@0@/lib/lin_x64/'.format(mfx_home))
-mfx_deps += [libmfx]
-
 libstdcc = compiler.find_library('stdc++')
 mfx_deps += [libstdcc]
 
@eero-t eero-t changed the title Broken meson.build MediaSDK detection Meson build fail: Broken meson.build MediaSDK detection Jan 7, 2019
@eero-t
Copy link
Author

eero-t commented Jan 7, 2019

One reason why use of something like MFX_HOME is bad, is that install target for your dependencies isn't necessarily a static thing.

Every one of our builds is done to a different directory (to retain build artifacts at the build server), i.e. MFX_HOME value would need to be re-generated every build. With pkg-config, everything works automatically, as pkg-config is something already supported by (Linux) build tools, and MediaSDK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant