diff options
author | dundargoc <gocdundar@gmail.com> | 2023-12-17 15:40:09 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-12-30 14:22:25 +0100 |
commit | bf0be0f63e7142675f1376781c128116d12c520d (patch) | |
tree | c73b0afff680bd79c191ac751154ef119f6a6258 /CMakeLists.txt | |
parent | c89292fcb7f2ebf06efb7c1d00c28f34c6f68fec (diff) | |
download | rneovim-bf0be0f63e7142675f1376781c128116d12c520d.tar.gz rneovim-bf0be0f63e7142675f1376781c128116d12c520d.tar.bz2 rneovim-bf0be0f63e7142675f1376781c128116d12c520d.zip |
build: various improvements
- Use `#pragma once` for `cmake.config/config.h.in`
- Remove unused variable `CACHED_GENERATED_DIR`
- Reorganize and sort variables
- Introduce `STYLUA_DIRS` variable to ensure the `formatlua` and
`lintlua-stylua` operates on the same files.
- Adjust variable scope to avoid using hacky directory properties.
- Add more necessary runtime files as test dependencies
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fefafba46..bcce95ef1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,11 +33,20 @@ include(InstallHelpers) include(PreventInTreeBuilds) include(Util) +#------------------------------------------------------------------------------- +# Variables +#------------------------------------------------------------------------------- +set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack) +set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime) +set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches) + +# GENERATED_RUNTIME_DIR +set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags) +set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim) + set_directory_properties(PROPERTIES EP_PREFIX "${DEPS_BUILD_DIR}") -set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches) - find_program(CCACHE_PRG ccache) if(CCACHE_PRG) set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG}) @@ -218,11 +227,13 @@ endif() find_program(SHELLCHECK_PRG shellcheck ${LINT_REQUIRED}) find_program(STYLUA_PRG stylua ${LINT_REQUIRED}) +set(STYLUA_DIRS runtime scripts src test/unit) + add_glob_target( TARGET lintlua-luacheck COMMAND $<TARGET_FILE:nvim> FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr luacheck -q - GLOB_DIRS runtime/ scripts/ src/ test/ + GLOB_DIRS runtime scripts src test GLOB_PAT *.lua TOUCH_STRATEGY SINGLE) add_dependencies(lintlua-luacheck lua-dev-deps) @@ -231,7 +242,7 @@ add_glob_target( TARGET lintlua-stylua COMMAND ${STYLUA_PRG} FLAGS --color=always --check --respect-ignores - GLOB_DIRS runtime/ scripts/ src/ test/unit/ + GLOB_DIRS ${STYLUA_DIRS} GLOB_PAT *.lua TOUCH_STRATEGY SINGLE) @@ -258,7 +269,7 @@ add_glob_target( TARGET formatlua COMMAND ${STYLUA_PRG} FLAGS --respect-ignores - GLOB_DIRS runtime/ scripts/ src/ test/unit/ + GLOB_DIRS ${STYLUA_DIRS} GLOB_PAT *.lua) add_custom_target(format) |