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.
This commit is contained in:
Eli Schwartz
2022-01-30 21:50:42 -05:00
parent 5b2c6c776a
commit 84c05453db
+1 -1
View File
@@ -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