diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-04-02 15:58:55 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-04-02 16:03:29 +0200 |
| commit | e5c4c1415bff4ae5e08a7d1ec7cdcce3ba589eb2 (patch) | |
| tree | 302a1a71e7ab6bb99c6b003e05faa01e16374754 /CMake | |
| parent | 7a879568b3fd16ce84ee4fa3e268272eb53fc590 (diff) | |
Add replacement for potentially missing trunc() (#944)
- add configure + CMake checks to define HAVE_TRUNC in config.h
- src/Fl_Timeout.cxx: add local replacement function
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/resources.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CMake/resources.cmake b/CMake/resources.cmake index 435ff32b8..c483a113e 100644 --- a/CMake/resources.cmake +++ b/CMake/resources.cmake @@ -156,10 +156,12 @@ find_library(LIB_GLEW NAMES GLEW glew32) find_library(LIB_jpeg jpeg) find_library(LIB_png png) find_library(LIB_zlib z) +find_library(LIB_m m) mark_as_advanced(LIB_dl LIB_fontconfig LIB_freetype) mark_as_advanced(LIB_GL LIB_MesaGL LIB_GLEW) mark_as_advanced(LIB_jpeg LIB_png LIB_zlib) +mark_as_advanced(LIB_m) ####################################################################### # functions @@ -206,6 +208,12 @@ check_function_exists(vsnprintf HAVE_VSNPRINTF) check_function_exists(setenv HAVE_SETENV) +if(LIB_m) + set(CMAKE_REQUIRED_LIBRARIES ${LIB_m}) + check_function_exists(trunc HAVE_TRUNC) + set(CMAKE_REQUIRED_LIBRARIES) +endif(LIB_m) + if(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX) set(MSG "POSIX compatible scandir") message(STATUS "Looking for ${MSG}") |
