neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 4c91194611086916c833d61e28e2f5e689316e83
parent cc197d04fc36a6ee4219f20772a7b39dd976edfd
Author: dundargoc <gocdundar@gmail.com>
Date:   Sat, 27 Jan 2024 19:10:41 +0100

build: various fixes

- Consistently use the variable CMAKE_BUILD_TYPE to select build type.
- Remove broken `doc_html` target.
- Remove swap files created by oldtest when cleaning.
- Only rerun `lintdoc` if any documentation files has changed.

Diffstat:
M.github/scripts/build_universal_macos.sh | 4++--
M.github/workflows/build.yml | 2+-
M.github/workflows/release.yml | 8++++----
MCMakeLists.txt | 2++
Mruntime/CMakeLists.txt | 11-----------
Mscripts/genappimage.sh | 2+-
Msrc/nvim/CMakeLists.txt | 7++++++-
Mtest/old/testdir/Makefile | 3++-
8 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/.github/scripts/build_universal_macos.sh b/.github/scripts/build_universal_macos.sh @@ -3,13 +3,13 @@ MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)" export MACOSX_DEPLOYMENT_TARGET cmake -S cmake.deps -B .deps -G Ninja \ - -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \ + -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 \ -D CMAKE_FIND_FRAMEWORK=NEVER cmake --build .deps cmake -B build -G Ninja \ - -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \ + -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 \ -D ENABLE_LIBINTL=OFF \ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - - run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV + - run: printf 'CMAKE_BUILD_TYPE=Release\n' >> $GITHUB_ENV - name: Build universal binary run: ./.github/scripts/build_universal_macos.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml @@ -29,11 +29,11 @@ jobs: - run: ./.github/scripts/install_deps.sh - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') run: | - echo 'NVIM_BUILD_TYPE=Release' >> $GITHUB_ENV + echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') run: | - echo 'NVIM_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV + echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV - name: appimage run: ./scripts/genappimage.sh ${APPIMAGE_TAG} @@ -69,9 +69,9 @@ jobs: - name: Install dependencies run: ./.github/scripts/install_deps.sh - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV + run: printf 'CMAKE_BUILD_TYPE=Release\n' >> $GITHUB_ENV - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV + run: printf 'CMAKE_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV - name: Build universal binary run: ./.github/scripts/build_universal_macos.sh - uses: actions/upload-artifact@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -39,6 +39,8 @@ include(Util) set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack) set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches) +file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt) + set_directory_properties(PROPERTIES EP_PREFIX "${DEPS_BUILD_DIR}") diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt @@ -55,8 +55,6 @@ foreach(PACKAGE ${PACKAGES}) endif() endforeach() -file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt) - set(BUILDDOCFILES) foreach(DF ${DOCFILES}) get_filename_component(F ${DF} NAME) @@ -75,15 +73,6 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS} WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}" ) -# TODO: This doesn't work. wait for "nvim -l" to land? -add_custom_target(doc_html - COMMAND $<TARGET_FILE:nvim_bin> - -V1 -es --clean -c "lua require('scripts.gen_help_html').gen('./build/runtime/doc', './build/doc_html', nil, 'todo_commit_id')" -c "0cq" - DEPENDS - ${GENERATED_HELP_TAGS} - WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc" -) - add_custom_target( nvim_runtime DEPENDS diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh @@ -26,7 +26,7 @@ APP_DIR="$APP.AppDir" ######################################################################## # Build and install nvim into the AppImage -make CMAKE_BUILD_TYPE="${NVIM_BUILD_TYPE}" +make CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" cmake --install build --prefix="$APP_BUILD_DIR/${APP_DIR}/usr" ######################################################################## diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt @@ -954,9 +954,14 @@ add_custom_target(doc-vim DEPENDS ${VIMDOC_FILES}) add_custom_target(doc) add_dependencies(doc doc-vim doc-eval) -add_custom_target(lintdoc +set(lintdoc_touch ${TOUCHES_DIR}/lintdoc) +add_custom_command( + OUTPUT ${lintdoc_touch} + COMMAND ${CMAKE_COMMAND} -E touch ${lintdoc_touch} COMMAND ${CMAKE_COMMAND} -E env "VIMRUNTIME=${NVIM_RUNTIME_DIR}" $<TARGET_FILE:nvim_bin> --clean -l scripts/lintdoc.lua WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + DEPENDS ${DOCFILES} USES_TERMINAL) +add_custom_target(lintdoc DEPENDS ${lintdoc_touch}) add_dependencies(lintdoc nvim) diff --git a/test/old/testdir/Makefile b/test/old/testdir/Makefile @@ -121,7 +121,8 @@ CLEAN_FILES := *.out \ .*.swo \ .gdbinit \ $(TMPDIR) \ - del + del \ + $(ROOT)/runtime/doc/.*.swp clean: $(RM) -rf $(CLEAN_FILES)