build: Fix MSVC build failure on CI #11865

clean-shared-libraries does nothing useful in MSVC build. Nevertheless,
it deletes ${DEPS_INSTALL_DIR}/lib/nvim/parser/c.dll and causes build
failure in CI.
This commit is contained in:
erw7 2020-02-14 17:45:41 +09:00 committed by GitHub
parent 1b200d9936
commit 146598efcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,13 +295,21 @@ if(WIN32)
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake) -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake)
endif() endif()
add_custom_target(clean-shared-libraries # clean-shared-libraries removes ${DEPS_INSTALL_DIR}/lib/nvim/parser/c.dll,
COMMAND ${CMAKE_COMMAND} # resulting in MSVC build failure in CI.
-DREMOVE_FILE_GLOB=${DEPS_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}* if (MSVC)
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake set(ALL_DEPS ${THIRD_PARTY_DEPS})
DEPENDS ${THIRD_PARTY_DEPS} else()
) add_custom_target(clean-shared-libraries
COMMAND ${CMAKE_COMMAND}
-DREMOVE_FILE_GLOB=${DEPS_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake
DEPENDS ${THIRD_PARTY_DEPS}
)
set(ALL_DEPS clean-shared-libraries)
endif()
add_custom_target(third-party ALL add_custom_target(third-party ALL
COMMAND ${CMAKE_COMMAND} -E touch .third-party COMMAND ${CMAKE_COMMAND} -E touch .third-party
DEPENDS clean-shared-libraries) DEPENDS ${ALL_DEPS}
)