| 1 |
# This file contains all the logic for running configure-time checks |
| 2 |
|
| 3 |
include(CheckSymbolExists) |
| 4 |
include(CheckIncludeFile) |
| 5 |
include(CheckIncludeFiles) |
| 6 |
include(CheckLibraryExists) |
| 7 |
|
| 8 |
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) |
| 9 |
check_symbol_exists(ppoll poll.h HAVE_PPOLL) |
| 10 |
check_symbol_exists(ptsname_r stdlib.h HAVE_PTSNAME_R) |
| 11 |
set(CMAKE_REQUIRED_DEFINITIONS) |
| 12 |
check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4) |
| 13 |
|
| 14 |
check_include_file(termios.h HAVE_TERMIOS_H) |
| 15 |
check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H) |
| 16 |
|
| 17 |
check_cxx_symbol_exists(process_vm_readv "sys/uio.h" HAVE_PROCESS_VM_READV) |
| 18 |
check_cxx_symbol_exists(__NR_process_vm_readv "sys/syscall.h" HAVE_NR_PROCESS_VM_READV) |
| 19 |
|
| 20 |
check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION) |
| 21 |
|
| 22 |
set(LLDB_INSTALL_LIBDIR_BASENAME "lib${LLDB_LIBDIR_SUFFIX}") |
| 23 |
|
| 24 |
# These checks exist in LLVM's configuration, so I want to match the LLVM names |
| 25 |
# so that the check isn't duplicated, but we translate them into the LLDB names |
| 26 |
# so that I don't have to change all the uses at the moment. |
| 27 |
set(LLDB_ENABLE_TERMIOS ${HAVE_TERMIOS_H}) |
| 28 |
if (UNIX) |
| 29 |
set(LLDB_ENABLE_POSIX ON) |
| 30 |
else() |
| 31 |
set(LLDB_ENABLE_POSIX OFF) |
| 32 |
endif() |
| 33 |
|
| 34 |
if(NOT LLDB_CONFIG_HEADER_INPUT) |
| 35 |
set(LLDB_CONFIG_HEADER_INPUT ${LLDB_INCLUDE_ROOT}/lldb/Host/Config.h.cmake) |
| 36 |
endif() |
| 37 |
|
| 38 |
if(NOT LLDB_CONFIG_HEADER_OUTPUT) |
| 39 |
set(LLDB_CONFIG_HEADER_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/lldb/Host/Config.h) |
| 40 |
endif() |
| 41 |
|
| 42 |
# This should be done at the end |
| 43 |
configure_file( |
| 44 |
${LLDB_CONFIG_HEADER_INPUT} |
| 45 |
${LLDB_CONFIG_HEADER_OUTPUT} |
| 46 |
) |