From 84c05453db61a5c518bda486ea36b0c00fc645a1 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 30 Jan 2022 21:02:44 -0500 Subject: [PATCH] meson: never require a libm libm is not guaranteed to exist. POSIX requires the math functions to exist, but doesn't require to have it be a standalone library. On platforms where libm exists as a standalone library, it will always be found by meson -- it is shipped with libc. If it is not found, then we can safely assume the linker will make the math functions available by default. See https://mesonbuild.com/howtox.html#add-math-library-lm-portably Fixes building with bin_tests=true on Windows. --- build/meson/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/meson/meson.build b/build/meson/meson.build index 0c29a7621..e0ea3dff9 100644 --- a/build/meson/meson.build +++ b/build/meson/meson.build @@ -92,7 +92,7 @@ feature_lz4 = get_option('lz4') # Dependencies # ============================================================================= -libm_dep = cc.find_library('m', required: bin_tests) +libm_dep = cc.find_library('m', required: false) thread_dep = dependency('threads', required: feature_multi_thread) use_multi_thread = thread_dep.found() # Arguments in dependency should be equivalent to those passed to pkg-config