Don't use check_library for libm
authorRoland Schulz <roland@utk.edu>
Sat, 27 Jun 2015 22:23:50 +0000 (18:23 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 28 Jun 2015 03:59:23 +0000 (05:59 +0200)
Using check_library doesn't work with build-ins like sqrt
with Werror. sqrt was anyhow only a placeholder for a standard
libm function. We really only need to know whether the library
exists.

Fixes #1750

Change-Id: I6a550cf8c8b8ea985b28130a4339935fb8c9741a

CMakeLists.txt

index 14c8090b6b1dc06b5896a3785c0a4fd5cfe5edc3..e042aa054fbc371be88018d2b8157cc3486848a6 100644 (file)
@@ -356,7 +356,7 @@ check_cxx_symbol_exists(rsqrtf            math.h       HAVE_RSQRTF)
 check_cxx_symbol_exists(sqrtf             math.h       HAVE_SQRTF)
 
 include(CheckLibraryExists)
-check_library_exists(m sqrt "" HAVE_LIBM)
+find_library(HAVE_LIBM m)
 check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
 check_library_exists(m feenableexcept "" HAVE_FEENABLEEXCEPT)