Fix dumpcap build on platforms where isfinite() is in libm.
authorGuy Harris <gharris@sonic.net>
Wed, 6 Dec 2023 09:37:50 +0000 (01:37 -0800)
committerGuy Harris <gharris@sonic.net>
Wed, 6 Dec 2023 09:37:50 +0000 (01:37 -0800)
commit024f8a27bd0d6b4ed3da936002e925b2091bc82e
treecbb21a2d2b8c6ad4ade8a6ecc177186b61bdc51c
parent85e0909553e0ac3b1f4db43befe7a83a615bc515
Fix dumpcap build on platforms where isfinite() is in libm.

dumpcap is statically linked with libwsutil and, in the main branch,
uses the JSON dumper code in that library.  This means that linking with
libwsutil causes the object file for the JSON dumper to be included, and
that code calls isfinite().

As this is linking with a *static* libwsutil, and as, on most if not all
platforms, a static library, unlike a dynamic library, doesn't include
an indication of other libraries on which the library depends, linking
statically with libwsutil does not cause the code that's being linked to
link with those other libraries.

If isfinite() is in the standard system library (as it appears to be in
macOS), that's not a problem.

However, if it's in libm (as it appears to be in FreeBSD), that *is* a
problem, as it means dumpcap needs to be linked with libm.  Make it so.
CMakeLists.txt