neovim-0.10.3-specify-POST_BUILD-when-using-add_custom_command.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. https://github.com/neovim/neovim/pull/31121
  2. From: dundargoc <gocdundar@gmail.com>
  3. Date: Fri, 8 Nov 2024 17:16:43 +0100
  4. Subject: [PATCH] build: specify POST_BUILD when using add_custom_command
  5. This is needed specifically for the second signature of
  6. add_custom_command, which appends an operation to an existing target.
  7. This will prevent the cmake warning CMP0175.
  8. Reference: https://cmake.org/cmake/help/latest/policy/CMP0175.html
  9. --- a/cmake/Util.cmake
  10. +++ b/cmake/Util.cmake
  11. @@ -61,6 +61,7 @@ function(add_glob_target)
  12. if(NOT ARG_COMMAND)
  13. add_custom_target(${ARG_TARGET})
  14. add_custom_command(TARGET ${ARG_TARGET}
  15. + POST_BUILD
  16. COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET} SKIP: ${ARG_COMMAND} not found")
  17. return()
  18. endif()
  19. --- a/src/nvim/CMakeLists.txt
  20. +++ b/src/nvim/CMakeLists.txt
  21. @@ -750,6 +750,7 @@ add_custom_target(nvim_runtime_deps)
  22. if(WIN32)
  23. # Copy DLLs and third-party tools to bin/ and install them along with nvim
  24. add_custom_command(TARGET nvim_runtime_deps
  25. + POST_BUILD
  26. COMMAND ${CMAKE_COMMAND} -E ${COPY_DIRECTORY} ${PROJECT_BINARY_DIR}/windows_runtime_deps/
  27. ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
  28. install(DIRECTORY ${PROJECT_BINARY_DIR}/windows_runtime_deps/
  29. @@ -791,7 +792,10 @@ file(MAKE_DIRECTORY ${BINARY_LIB_DIR})
  30. # install treesitter parser if bundled
  31. if(EXISTS ${DEPS_PREFIX}/lib/nvim/parser)
  32. - add_custom_command(TARGET nvim_runtime_deps COMMAND ${CMAKE_COMMAND} -E ${COPY_DIRECTORY} ${DEPS_PREFIX}/lib/nvim/parser ${BINARY_LIB_DIR}/parser)
  33. + add_custom_command(
  34. + TARGET nvim_runtime_deps
  35. + POST_BUILD
  36. + COMMAND ${CMAKE_COMMAND} -E ${COPY_DIRECTORY} ${DEPS_PREFIX}/lib/nvim/parser ${BINARY_LIB_DIR}/parser)
  37. endif()
  38. install(DIRECTORY ${BINARY_LIB_DIR}