From 0756ef643491493903bb7b673b2f744e78d695ca Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Fri, 3 Apr 2015 23:58:58 +0200 Subject: [PATCH] cmake: fix detection of powf() with GCC --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 379ca30..8d70100 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,13 @@ check_include_files(stdint.h GMIO_HAVE_STDINT_H) if(NOT BUILD_STRICT_C90) # Check C99 features check_function_exists(strtof GMIO_HAVE_STRTOF_FUNC) + + if(CMAKE_COMPILER_IS_GNUCC) + list(APPEND CMAKE_REQUIRED_LIBRARIES m) # -lm + endif() check_function_exists(powf GMIO_HAVE_POWF_FUNC) + set(CMAKE_REQUIRED_LIBRARIES) + check_include_files(stdbool.h GMIO_HAVE_STDBOOL_H) # Check POSIX features