• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1openexr_dep = dependency('OpenEXR', modules: ['OpenEXR::IlmImf'], required: get_option('openexr'))
2
3if openexr_dep.found()
4  openexr_override_options = []
5  # Older versions of openexr fail to build with -Werror when using GCC >= 9.2
6  # and Clang >= 6 because it uses deprecated C++98 syntax. Explicitly pass
7  # -std=c++98 in those cases. Just checking the openexr version is not enough
8  # because distros (such as Ubuntu 18.04) have backported patches due to which
9  # older openexr versions now require C++11.
10  if openexr_dep.version().version_compare('< 2.4.0')
11    # Check whether using the openexr headers with -Werror causes an error
12    if cxx.has_argument('-Werror') and cxx.check_header('ImfRgbaFile.h', dependencies: openexr_dep)
13      if not cxx.check_header('ImfRgbaFile.h', dependencies: openexr_dep, args: '-Werror')
14        # If setting -std to c++98 fixes it, use that! Else, warn.
15        if cxx.check_header('ImfRgbaFile.h', dependencies: openexr_dep, args: ['-Werror', '-std=c++98'])
16          openexr_override_options = ['cpp_std=c++98']
17        else
18          warning('openexr headers can\'t be included with \'-Werror\', and no workaround found')
19        endif
20      endif
21    endif
22  endif
23
24  gstopenexr = library('gstopenexr',
25    'gstopenexr.c',
26    'gstopenexrdec.cpp',
27    c_args: gst_plugins_bad_args,
28    cpp_args: gst_plugins_bad_args,
29    link_args: noseh_link_args,
30    include_directories: [configinc, libsinc],
31    dependencies: [gstvideo_dep, openexr_dep],
32    override_options: openexr_override_options,
33    install: true,
34    install_dir: plugins_install_dir,
35  )
36  pkgconfig.generate(gstopenexr, install_dir: plugins_pkgconfig_install_dir)
37  plugins += [gstopenexr]
38endif
39