From 146598efcce48cfae13a6d15f5c5e7574c7c0384 Mon Sep 17 00:00:00 2001 From: erw7 Date: Fri, 14 Feb 2020 17:45:41 +0900 Subject: [PATCH] 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. --- third-party/CMakeLists.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index cff063e894..a321840fef 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -295,13 +295,21 @@ if(WIN32) -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake) endif() -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} -) +# clean-shared-libraries removes ${DEPS_INSTALL_DIR}/lib/nvim/parser/c.dll, +# resulting in MSVC build failure in CI. +if (MSVC) + set(ALL_DEPS ${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 COMMAND ${CMAKE_COMMAND} -E touch .third-party - DEPENDS clean-shared-libraries) + DEPENDS ${ALL_DEPS} +)