include(CheckFunctionExists)
include(CheckCXXSourceCompiles)
+if( UNIX )
+ # Used by check_symbol_exists:
+ set(CMAKE_REQUIRED_LIBRARIES m)
+endif()
+
# Helper macros and functions
macro(add_cxx_include result files)
set(${result} "")
check_include_file(termios.h HAVE_TERMIOS_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(utime.h HAVE_UTIME_H)
+check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H)
check_include_file(windows.h HAVE_WINDOWS_H)
# library checks
check_symbol_exists(isnan math.h HAVE_ISNAN_IN_MATH_H)
check_symbol_exists(ceilf math.h HAVE_CEILF)
check_symbol_exists(floorf math.h HAVE_FLOORF)
+check_symbol_exists(nearbyintf math.h HAVE_NEARBYINTF)
check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
check_symbol_exists(malloc_zone_statistics malloc/malloc.h
HAVE_MALLOC_ZONE_STATISTICS)
check_type_exists(u_int64_t "${headers}" HAVE_U_INT64_T)
# available programs checks
-find_program(DOTTY_EXECUTABLE dotty)
-if(DOTTY_EXECUTABLE)
- set(HAVE_DOTTY 1)
- set(LLVM_PATH_DOTTY ${DOTTY_EXECUTABLE})
- mark_as_advanced(HAVE_DOTTY)
- mark_as_advanced(LLVM_PATH_DOTTY)
-endif()
+function(llvm_find_program name)
+ string(TOUPPER ${name} NAME)
+ find_program(LLVM_PATH_${NAME} ${name})
+ mark_as_advanced(LLVM_PATH_${NAME})
+ if(LLVM_PATH_${NAME})
+ set(HAVE_${NAME} 1 CACHE INTERNAL "Is ${name} available ?")
+ mark_as_advanced(HAVE_${NAME})
+ else(LLVM_PATH_${NAME})
+ set(HAVE_${NAME} "" CACHE INTERNAL "Is ${name} available ?")
+ endif(LLVM_PATH_${NAME})
+endfunction()
+
+llvm_find_program(gv)
+llvm_find_program(circo)
+llvm_find_program(twopi)
+llvm_find_program(neato)
+llvm_find_program(fdp)
+llvm_find_program(dot)
+llvm_find_program(dotty)
# Define LLVM_MULTITHREADED if gcc atomic builtins exists.
include(CheckAtomic)
include(GetTargetTriple)
get_target_triple(LLVM_HOSTTRIPLE)
-message(STATUS "LLVM_HOSTTRIPLE: ${LLVM_HOSTTRIPLE}")
# FIXME: We don't distinguish the target and the host. :(
set(TARGET_TRIPLE "${LLVM_HOSTTRIPLE}")