mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
Merge pull request #22561 from bfredl/cmakeinstall
refactor(build): make installation of runtime/ more effective
This commit is contained in:
commit
e0e474a4bb
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@ -241,17 +241,9 @@ jobs:
|
||||
fi
|
||||
|
||||
# Check that all runtime files were installed
|
||||
for file in $(git -C runtime ls-files '*.vim' '*.ps' '*.dict' '*.py' '*.tutor'); do
|
||||
for file in $(git -C runtime ls-files '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' '*.awk' '*.sh' '*.bat'); do
|
||||
if ! test -e "$INSTALL_PREFIX/share/nvim/runtime/$file"; then
|
||||
printf "%s%s" 'It appears that %s is not installed.' "$file"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check that some runtime files are installed and are executables
|
||||
for file in $(git -C runtime ls-files '*.awk' '*.sh' '*.bat'); do
|
||||
if ! test -x "$INSTALL_PREFIX/share/nvim/runtime/$file"; then
|
||||
printf "%s%s" 'It appears that %s is not installed or is not executable.' "$file"
|
||||
printf "It appears that %s is not installed." "$file"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
@ -167,12 +167,3 @@ function(glob_wrapper outvar)
|
||||
endif()
|
||||
set(${outvar} ${${outvar}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(globrecurse_wrapper outvar root)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
file(GLOB_RECURSE ${outvar} RELATIVE ${root} ${ARGN})
|
||||
else()
|
||||
file(GLOB_RECURSE ${outvar} CONFIGURE_DEPENDS RELATIVE ${root} ${ARGN})
|
||||
endif()
|
||||
set(${outvar} ${${outvar}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
@ -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)
|
||||
glob_wrapper(RUNTIME_ROOT_FILES *.vim *.lua *.ico)
|
||||
install_helper(FILES ${RUNTIME_ROOT_FILES}
|
||||
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_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/)
|
||||
|
Loading…
Reference in New Issue
Block a user