diff options
author | dundargoc <gocdundar@gmail.com> | 2024-01-19 13:21:25 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-01-20 12:59:27 +0100 |
commit | f936a962d04f9937946018cc1386f20bda6fc1de (patch) | |
tree | d9830f132b1ee1de25ad8032b183a500a9baaeeb /CMakeLists.txt | |
parent | ed103cde28dd6aeb8d240240309c26d3f20060f4 (diff) | |
download | rneovim-f936a962d04f9937946018cc1386f20bda6fc1de.tar.gz rneovim-f936a962d04f9937946018cc1386f20bda6fc1de.tar.bz2 rneovim-f936a962d04f9937946018cc1386f20bda6fc1de.zip |
build: create separate targets for nvim with and without runtime files
This distinction is important for correct dependency management, as the
nvim binary is used to create some runtime files. The nvim binary (and
the target to build it) is thus called `nvim_bin` and the target to
build all of nvim (binary+runtime) is called `nvim`.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d64d1fc723..6dedbfd714 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,13 +37,8 @@ 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}") @@ -60,6 +55,12 @@ if(${CMAKE_VERSION} VERSION_LESS 3.20) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.26) + set(COPY_DIRECTORY copy_directory_if_different) +else() + set(COPY_DIRECTORY copy_directory) +endif() + # Prefer our bundled versions of dependencies. if(DEFINED ENV{DEPS_BUILD_DIR}) set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies") @@ -231,7 +232,7 @@ set(STYLUA_DIRS runtime scripts src test) add_glob_target( TARGET lintlua-luacheck - COMMAND $<TARGET_FILE:nvim> + COMMAND $<TARGET_FILE:nvim_bin> FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr luacheck -q GLOB_DIRS runtime scripts src test GLOB_PAT *.lua @@ -258,8 +259,8 @@ add_glob_target( TOUCH_STRATEGY PER_DIR) add_custom_target(lintcommit - COMMAND $<TARGET_FILE:nvim> -u NONE -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main) -add_dependencies(lintcommit nvim) + COMMAND $<TARGET_FILE:nvim_bin> -u NONE -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main) +add_dependencies(lintcommit nvim_bin) add_custom_target(lint) add_dependencies(lint lintc lintlua lintsh lintcommit) @@ -280,6 +281,9 @@ install_helper( FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) +add_custom_target(nvim ALL) +add_dependencies(nvim nvim_bin nvim_runtime_deps nvim_runtime) + add_subdirectory(src/nvim) add_subdirectory(cmake.config) add_subdirectory(runtime) |