mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
Allow building as a static -fPIC library
This commit is contained in:
@@ -208,6 +208,14 @@ if(SANITIZE)
|
||||
set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=address -fsanitize=undefined ")
|
||||
endif()
|
||||
|
||||
add_library(libnvim STATIC EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_SOURCES}
|
||||
${NEOVIM_SOURCES} ${NEOVIM_HEADERS})
|
||||
target_link_libraries(libnvim ${NVIM_LINK_LIBRARIES})
|
||||
set_target_properties(libnvim PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
OUTPUT_NAME nvim)
|
||||
set_property(TARGET libnvim APPEND_STRING PROPERTY COMPILE_FLAGS " -DMAKE_LIB ")
|
||||
|
||||
add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_SOURCES}
|
||||
${NEOVIM_SOURCES} ${NEOVIM_HEADERS})
|
||||
target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES})
|
||||
|
@@ -194,7 +194,11 @@ void early_init(void)
|
||||
}
|
||||
|
||||
#ifndef NO_VIM_MAIN /* skip this for unittests */
|
||||
#ifdef MAKE_LIB
|
||||
int nvim_main(int argc, char **argv)
|
||||
#else
|
||||
int main(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
char_u *fname = NULL; /* file name from command line */
|
||||
mparm_T params; /* various parameters passed between
|
||||
|
Reference in New Issue
Block a user