summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2024-08-25 17:45:42 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2024-08-25 17:51:15 +0200
commit67e0547bf9cc2553ac327cd054d5ceb30e53cdce (patch)
tree180718d8524f19b806a6d9618adf541489c0f2af /CMake
parentfc57a518362741207c155bb23c4b46e1b4ed3e02 (diff)
CMake: replace check_function_exists() for trunc() (#1049)
Part 1: replace the check for trunc() with check_symbol_exists(). Part 2 (to be done): replace all occurrences of the macro check_function_exists() with check_symbol_exists() if possible.
Diffstat (limited to 'CMake')
-rw-r--r--CMake/resources.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMake/resources.cmake b/CMake/resources.cmake
index 9b8ceed1b..45a0ddcae 100644
--- a/CMake/resources.cmake
+++ b/CMake/resources.cmake
@@ -27,6 +27,11 @@
set(CMAKE_REQUIRED_QUIET 1)
include(CheckIncludeFiles)
+include(CheckSymbolExists)
+
+# FIXME: replace check_function_exists() with check_symbol_exists()
+# FIXME: ... and remove the next line when done (Issue #1049)
+include(CheckFunctionExists)
macro(fl_find_header VAR HEADER)
check_include_files("${HEADER}" ${VAR})
@@ -235,7 +240,9 @@ check_function_exists(setenv HAVE_SETENV)
if(LIB_m AND NOT WIN32)
set(CMAKE_REQUIRED_LIBRARIES ${LIB_m})
endif()
-check_function_exists(trunc HAVE_TRUNC)
+
+check_symbol_exists(trunc "math.h" HAVE_TRUNC)
+
set(CMAKE_REQUIRED_LIBRARIES)
if(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)