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