aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-03-07 15:00:51 +0100
committerbfredl <bjorn.linse@gmail.com>2023-03-07 20:16:52 +0100
commit30632dd21ab243bb2c4eb115819a32fdfd9155dc (patch)
treeebe91e82ac53a5b36a5512432b98fb2b5f510484 /runtime
parent706bcab75eaad2c370d61bf828531054439d3a3e (diff)
downloadrneovim-30632dd21ab243bb2c4eb115819a32fdfd9155dc.tar.gz
rneovim-30632dd21ab243bb2c4eb115819a32fdfd9155dc.tar.bz2
rneovim-30632dd21ab243bb2c4eb115819a32fdfd9155dc.zip
refactor(build): make installation of runtime/ more effective
Currently files to install in runtime/ is detected by recursive glob pattern which has two problems: - cmake needs to do a of work at config time and build/runtime/cmake_install.cmake becomes HUGE (2.5MB, biggest config file) - we need to explicitly specify each file suffix used in the entire runtime, which is duplication of information. These globs specify every single file in a subdirectory. Thus, we can just install every runtime/ subdirectory as a single install command. Furthermore, at the top-level, only .vim and .lua files need to be installed. Further possible refactor: we could move files which does not belong in $PREFIX/runtime out of $REPO/runtime. Then runtime could be installed with a single install_helper(DIRECTORY ...) command.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/CMakeLists.txt30
1 files changed, 12 insertions, 18 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index 581a4545db..c6447721a0 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -116,23 +116,17 @@ install_helper(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps)
-install_helper(
- FILES ${CMAKE_CURRENT_SOURCE_DIR}/neovim.ico
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime)
-
-globrecurse_wrapper(RUNTIME_PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} *.awk *.sh *.bat)
-
-foreach(PROG ${RUNTIME_PROGRAMS})
- get_filename_component(BASEDIR ${PROG} DIRECTORY)
- install_helper(PROGRAMS ${PROG}
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
+glob_wrapper(RUNTIME_ROOT_FILES *.vim *.lua *.ico)
+install_helper(FILES ${RUNTIME_ROOT_FILES}
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/)
+
+glob_wrapper(RUNTIME_DIRS */)
+foreach(D ${RUNTIME_DIRS})
+ if(IS_DIRECTORY ${D})
+ install_helper(DIRECTORY ${D}
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/)
+ endif()
endforeach()
-globrecurse_wrapper(RUNTIME_FILES ${CMAKE_CURRENT_SOURCE_DIR}
- *.vim *.lua *.scm *.dict *.py *.rb *.ps *.spl *.tutor *.tutor.json)
-
-foreach(F ${RUNTIME_FILES})
- get_filename_component(BASEDIR ${F} DIRECTORY)
- install_helper(FILES ${F}
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
-endforeach()
+# only foo.sh script in runtime/
+install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/macros/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/macros/)