From 7db0188cb257d42b8be128ed783d288c4bc60475 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 24 Jul 2018 14:47:58 +0200 Subject: [PATCH] CMake: Use check_symbol_exists instead of check_function_exists The documentation for the CheckFunctionExists module says that it is better to use CheckSymbolExists and lists some reasons. For our purpose, the reason is that check_function_exists is incompatible with -Werror. Signed-off-by: Uli Schlachter --- awesomeConfig.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 892b88e6..ea1d6057 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -158,8 +158,8 @@ set(AWESOME_DEPENDENCIES pkg_check_modules(AWESOME_REQUIRED REQUIRED ${AWESOME_DEPENDENCIES}) # Check for backtrace_symbols() -include(CheckFunctionExists) -check_function_exists(backtrace_symbols HAS_EXECINFO) +include(CheckSymbolExists) +check_symbol_exists(backtrace_symbols execinfo.h HAS_EXECINFO) if(NOT HAS_EXECINFO) find_library(LIB_EXECINFO execinfo) if(LIB_EXECINFO) @@ -176,11 +176,11 @@ else() endif() # Do we need libm for round()? -check_function_exists(round HAS_ROUND_WITHOUT_LIBM) +check_symbol_exists(round math.h HAS_ROUND_WITHOUT_LIBM) if(NOT HAS_ROUND_WITHOUT_LIBM) SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m) set(AWESOME_REQUIRED_LDFLAGS ${AWESOME_REQUIRED_LDFLAGS} m) - check_function_exists(round HAS_ROUND_WITH_LIBM) + check_symbol_exists(round math.h HAS_ROUND_WITH_LIBM) if(NOT HAS_ROUND_WITH_LIBM) message(FATAL_ERROR "Did not find round()") endif()