meson.build: test for and link against libatomic if it exists
It's needed on some platforms for some subset (or all) atomic operations and checking for the cases when it's actually needed is quite complex. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4300 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8637>
This commit is contained in:
parent
e845b596a2
commit
f2b5c0b602
@ -48,15 +48,12 @@ if host_system not in ['windows', 'linux']
|
|||||||
subdir_done()
|
subdir_done()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Linux ARM would need -latomic for std::atomic<int64_t>
|
# Check for libatomic for use of C11 atomics: some architectures need
|
||||||
if host_system == 'linux' and host_machine.cpu_family() in ['aarch64', 'arm']
|
# to link explicitly to this library.
|
||||||
libatomic_dep = cxx.find_library('atomic', required: get_option('cuda-nvmm'))
|
# TODO: Once meson 1.7 is in use, this can be updated to
|
||||||
if not libatomic_dep.found()
|
# dependency('atomic')
|
||||||
subdir_done()
|
atomic_dep = cxx.find_library('atomic', required: false)
|
||||||
endif
|
gstcuda_platform_dep += [atomic_dep]
|
||||||
|
|
||||||
gstcuda_platform_dep += [libatomic_dep]
|
|
||||||
endif
|
|
||||||
|
|
||||||
cuda_win32_headers = [
|
cuda_win32_headers = [
|
||||||
'initguid.h',
|
'initguid.h',
|
||||||
|
@ -162,7 +162,7 @@ gstaudio = library('gstaudio-@0@'.format(api_version),
|
|||||||
soversion : soversion,
|
soversion : soversion,
|
||||||
darwin_versions : osxversion,
|
darwin_versions : osxversion,
|
||||||
install : true,
|
install : true,
|
||||||
dependencies : gstaudio_deps,
|
dependencies : [ gstaudio_deps, base_platform_dep ],
|
||||||
)
|
)
|
||||||
pkg_name = 'gstreamer-audio-1.0'
|
pkg_name = 'gstreamer-audio-1.0'
|
||||||
pkgconfig.generate(gstaudio,
|
pkgconfig.generate(gstaudio,
|
||||||
|
@ -398,6 +398,15 @@ else
|
|||||||
core_conf.set('DISABLE_ORC', 1)
|
core_conf.set('DISABLE_ORC', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
base_platform_dep = []
|
||||||
|
# Check for libatomic for use of C11 atomics: some architectures need
|
||||||
|
# to link explicitly to this library.
|
||||||
|
# TODO: Once meson 1.7 is in use, this can be updated to
|
||||||
|
# dependency('atomic')
|
||||||
|
atomic_dep = cc.find_library('atomic', required: false)
|
||||||
|
|
||||||
|
base_platform_dep += [atomic_dep]
|
||||||
|
|
||||||
# Used to build SSE* things in audio-resampler
|
# Used to build SSE* things in audio-resampler
|
||||||
sse_args = '-msse'
|
sse_args = '-msse'
|
||||||
sse2_args = '-msse2'
|
sse2_args = '-msse2'
|
||||||
|
@ -599,6 +599,13 @@ if nsl_lib.found()
|
|||||||
network_deps += nsl_lib
|
network_deps += nsl_lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Check for libatomic for use of C11 atomics: some architectures need
|
||||||
|
# to link explicitly to this library.
|
||||||
|
# TODO: Once meson 1.7 is in use, this can be updated to
|
||||||
|
# dependency('atomic')
|
||||||
|
atomic_dep = cc.find_library('atomic', required: false)
|
||||||
|
platform_deps += atomic_dep
|
||||||
|
|
||||||
gir = find_program('g-ir-scanner', required : get_option('introspection'))
|
gir = find_program('g-ir-scanner', required : get_option('introspection'))
|
||||||
gnome = import('gnome')
|
gnome = import('gnome')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user