neovim/config/CMakeLists.txt
John Szakmeister a3ec68ce1e Use check_symbol_exists() instead of check_function_exists().
This is mostly a revert of 477031c03b.
Now that we are not setting `CMAKE_C_FLAGS`, the check can work
correctly and it helps `pcc` (portable c compiler) make it further
along--though it still doesn't produce usable results (see #427 for the
details).
2014-04-03 04:32:27 -04:00

35 lines
956 B
CMake

include(CheckTypeSize)
include(CheckSymbolExists)
check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG)
check_type_size("time_t" SIZEOF_TIME_T)
check_type_size("off_t" SIZEOF_OFF_T)
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
# generate configuration header and update include directories
configure_file (
"${PROJECT_SOURCE_DIR}/config/config.h.in"
"${PROJECT_BINARY_DIR}/config/auto/config.h"
)
# generate pathdef.c
find_program(WHOAMI_PROG whoami)
find_program(HOSTNAME_PROG hostname)
if (EXISTS ${WHOAMI_PROG})
execute_process(COMMAND ${WHOAMI_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE USERNAME)
endif()
if (EXISTS ${HOSTNAME_PROG})
execute_process(COMMAND ${HOSTNAME_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE HOSTNAME)
endif()
configure_file (
"${PROJECT_SOURCE_DIR}/config/pathdef.c.in"
"${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
ESCAPE_QUOTES)