diff options
| -rw-r--r-- | mesonbuild/dependencies/misc.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 1b454181d..3ab2194e3 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -56,24 +56,22 @@ packages['netcdf'] = netcdf_factory class AtomicBuiltinDependency(BuiltinDependency): def __init__(self, name: str, env: Environment, kwargs: T.Dict[str, T.Any]): super().__init__(name, env, kwargs) - self.feature_since = ('1.7.0', "consider checking for `atomic_fetch_add` of a 64-bit type with and without `find_library('atomic')`") + self.feature_since = ('1.7.0', "consider checking for `atomic_flag_clear` with and without `find_library('atomic')`") - code = '''#include <stdatomic.h>\n\nint main() {\n atomic_int_least64_t a;\n return atomic_fetch_add(&b, 1);\n}''' # [ignore encoding] this is C, not python, Mr. Lint - - self.is_found = bool(self.clib_compiler.links(code, env)[0]) + if self.clib_compiler.has_function('atomic_flag_clear', '#include <stdatomic.h>', env)[0]: + self.is_found = True class AtomicSystemDependency(SystemDependency): def __init__(self, name: str, env: Environment, kwargs: T.Dict[str, T.Any]): super().__init__(name, env, kwargs) - self.feature_since = ('1.7.0', "consider checking for `atomic_fetch_add` of a 64-bit type with and without `find_library('atomic')`") + self.feature_since = ('1.7.0', "consider checking for `atomic_flag_clear` with and without `find_library('atomic')`") h = self.clib_compiler.has_header('stdatomic.h', '', env) - if not h[0]: - return - self.link_args = self.clib_compiler.find_library('atomic', env, [], self.libtype) - self.is_found = bool(self.link_args) + + if h[0] and self.link_args: + self.is_found = True class DlBuiltinDependency(BuiltinDependency): |
