llvm.org GIT mirror llvm / a447cfe
CMake: Pass -lm to check_symbol_exists for detecting several math functions like floorf, ceilf, ... Add test for detecting nearbyintf. This change was prompted by test/Transforms/SimplifyLibCalls/floor.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86954 91177308-0d34-0410-b5e6-96231b3b80d8 Oscar Fuentes 10 years ago
2 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
22 include(CheckSymbolExists)
33 include(CheckFunctionExists)
44 include(CheckCXXSourceCompiles)
5
6 if( UNIX )
7 # Used by check_symbol_exists:
8 set(CMAKE_REQUIRED_LIBRARIES m)
9 endif()
510
611 # Helper macros and functions
712 macro(add_cxx_include result files)
8388 check_symbol_exists(isnan math.h HAVE_ISNAN_IN_MATH_H)
8489 check_symbol_exists(ceilf math.h HAVE_CEILF)
8590 check_symbol_exists(floorf math.h HAVE_FLOORF)
91 check_symbol_exists(nearbyintf math.h HAVE_NEARBYINTF)
8692 check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
8793 check_symbol_exists(malloc_zone_statistics malloc/malloc.h
8894 HAVE_MALLOC_ZONE_STATISTICS)
252252 #cmakedefine HAVE_NDIR_H ${HAVE_NDIR_H}
253253
254254 /* Define to 1 if you have the `nearbyintf' function. */
255 #undef HAVE_NEARBYINTF
255 #cmakedefine HAVE_NEARBYINTF ${HAVE_NEARBYINTF}
256256
257257 /* Define if the neat program is available */
258258 #cmakedefine HAVE_NEATO ${HAVE_NEATO}