blob: 1a5e6ebdc521d18f10c97cc1813c893c83433f31 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
include(CheckLibraryExists)
file( GLOB NEOVIM_SOURCES *.c )
foreach(sfile ${NEOVIM_SOURCES})
get_filename_component(f ${sfile} NAME)
if(${f} MATCHES "^(regexp_nfa.c)$")
list(APPEND to_remove ${sfile})
endif()
endforeach()
list(REMOVE_ITEM NEOVIM_SOURCES ${to_remove})
list(APPEND NEOVIM_SOURCES "${PROJECT_BINARY_DIR}/config/auto/pathdef.c")
file( GLOB OS_SOURCES os/*.c )
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(DEFINED ENV{SANITIZE})
message(STATUS "Enabling the sanitizers")
add_definitions(-DEXITFREE) # is this necessary for LeakSanitizer?
add_definitions(-fno-sanitize-recover -fno-omit-frame-pointer
-fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined)
set(CMAKE_EXE_LINKER_FLAGS
"-fsanitize=address -fsanitize=undefined ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS
"-fsanitize=address -fsanitize=undefined ${CMAKE_SHARED_LINKER_FLAGS}")
endif()
endif()
# Our dependencies come first.
if (LibIntl_FOUND)
list(APPEND NVIM_LINK_LIBRARIES ${LibIntl_LIBRARY})
endif()
check_library_exists(curses tgetent "" HAVE_LIBCURSES)
if (HAVE_LIBCURSES)
list(APPEND NVIM_LINK_LIBRARIES curses)
else()
find_package(Curses REQUIRED)
list(APPEND NVIM_LINK_LIBRARIES ${CURSES_LIBRARIES})
endif()
# Put these last on the link line, since multiple things may depend on them.
list(APPEND NVIM_LINK_LIBRARIES
${LIBUV_LIBRARIES}
${LUAJIT_LIBRARIES}
m
${CMAKE_THREAD_LIBS_INIT})
if(NOT DEFINED ENV{SKIP_EXEC})
add_executable(nvim ${NEOVIM_SOURCES} ${OS_SOURCES})
target_link_libraries(nvim ${NVIM_LINK_LIBRARIES})
install(TARGETS nvim RUNTIME DESTINATION bin)
endif()
if(NOT DEFINED ENV{SKIP_UNITTEST})
add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_SOURCES} ${OS_SOURCES})
target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES})
endif()
include_directories("${PROJECT_SOURCE_DIR}/src/proto")
|