diff --git a/build-utils-meson/libatomic/meson.build b/build-utils-meson/libatomic/meson.build new file mode 100644 index 000000000..d16d23817 --- /dev/null +++ b/build-utils-meson/libatomic/meson.build @@ -0,0 +1,8 @@ + +# Check if -latomic is needed +# This is needed for std::atomic on some platforms +# We did not manage to test this reliably on all platforms, so we hardcode +# it for now. +if host_machine.cpu_family() == 'arm' + deps_other += cxx.find_library('atomic') +endif diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 1d5f949af..101879e90 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -81,6 +81,7 @@ if host_machine.system() == 'windows' deps_other += [wsock32] endif +subdir('build-utils-meson/libatomic') subdir('build-utils-meson/threads') boost = dependency( diff --git a/src/libutil/meson.build b/src/libutil/meson.build index 61806120f..a6dc86394 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -53,16 +53,9 @@ endforeach configdata.set('HAVE_DECL_AT_SYMLINK_NOFOLLOW', cxx.has_header_symbol('fcntl.h', 'AT_SYMLINK_NOFOLLOW').to_int()) +subdir('build-utils-meson/libatomic') subdir('build-utils-meson/threads') -# Check if -latomic is needed -# This is needed for std::atomic on some platforms -# We did not manage to test this reliably on all platforms, so we hardcode -# it for now. -if host_machine.cpu_family() == 'arm' - deps_other += cxx.find_library('atomic') -endif - if host_machine.system() == 'windows' socket = cxx.find_library('ws2_32') deps_other += socket