aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-10-18 19:50:04 +0200
committerAnders Broman <a.broman58@gmail.com>2018-10-18 20:06:49 +0000
commit55cd530cf0db8ff7375f58a95ad9ca40a80509a2 (patch)
tree9e1d2c9896ab6f62b615ea003b434d446d8fe920 /cmake/modules
parent54286eb09cca14f0931f094c3f4874a2701729a6 (diff)
FindM.cmake: directly pass -lm to fix selective static linking
When CMAKE_FIND_LIBRARY_SUFFIXES is set to ".a" (in order to find only static libraries), executables would be linked with libm.a. This fails when the C runtime is not statically linked as well: https://bugzilla.redhat.com/show_bug.cgi?id=1433347 Change-Id: I1480607bd3d0678661694657a2709ee1c56f9530 Reviewed-on: https://code.wireshark.org/review/30253 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindM.cmake3
1 files changed, 1 insertions, 2 deletions
diff --git a/cmake/modules/FindM.cmake b/cmake/modules/FindM.cmake
index 2fb5429353..402a8bce8a 100644
--- a/cmake/modules/FindM.cmake
+++ b/cmake/modules/FindM.cmake
@@ -34,8 +34,7 @@ SET(CMAKE_FIND_FRAMEWORK LAST)
FIND_PATH(M_INCLUDE_DIR math.h)
SET(CMAKE_FIND_FRAMEWORK ${SAVED_CMAKE_FIND_FRAMEWORK})
-SET(M_NAMES m)
-FIND_LIBRARY(M_LIBRARY NAMES ${M_NAMES} )
+set(M_LIBRARY m)
# handle the QUIETLY and REQUIRED arguments and set M_FOUND to TRUE if
# all listed variables are TRUE