From: Eli Schwartz Date: Mon, 31 Jan 2022 02:02:44 +0000 (-0500) Subject: meson: never require a libm X-Git-Tag: v1.5.4^2~218^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84c05453db61a5c518bda486ea36b0c00fc645a1;p=thirdparty%2Fzstd.git 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. --- 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