build: support static build #34728

This commit is contained in:
Alex Díaz
2025-07-02 08:54:17 -06:00
committed by GitHub
parent 807bc00dd6
commit e91224bfaa
2 changed files with 27 additions and 0 deletions

View File

@@ -748,7 +748,11 @@ endif()
target_sources(nlua0 PUBLIC ${NLUA0_SOURCES})
if(STATIC_BUILD)
target_link_options(nvim_bin PRIVATE -static-libgcc -static-libstdc++ -static)
endif()
target_link_libraries(nvim_bin PRIVATE main_lib PUBLIC libuv)
install_helper(TARGETS nvim_bin)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:nvim_bin> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)