Skip to content

Commit

Permalink
Update YCM module from latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Apr 18, 2019
1 parent bb463c7 commit 151bb2b
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions cmake/ycm-modules/IncludeUrl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ macro(INCLUDE_URL _remoteFile)

get_filename_component(_filename ${_remoteFile} NAME)
if(DEFINED _IU_DESTINATION)
if(IS_DIRECTORY ${_IU_DESTINATION})
if(IS_DIRECTORY "${_IU_DESTINATION}")
set(_localFile "${_IU_DESTINATION}/${_filename}")
else()
set(_localFile "${_IU_DESTINATION}")
Expand All @@ -176,7 +176,6 @@ macro(INCLUDE_URL _remoteFile)
set(_localFile ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_filename})
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_localFile}")
endif()
set(_lockFile "${_localFile}.cmake")

if(DEFINED CMAKE_SCRIPT_MODE_FILE)
string(RANDOM LENGTH 8 _rand)
Expand Down Expand Up @@ -233,14 +232,6 @@ macro(INCLUDE_URL _remoteFile)
endif()
endif()

# Lock the file, in case 2 different processes are downloading the same file
# at the time
# file(LOCK) was added in CMake 3.2, therefore calling it in older version
# will fail.
if(NOT CMAKE_VERSION VERSION_LESS 3.2)
file(LOCK "${_lockFile}")
endif()

set(_shouldDownload 0)
set(_shouldFail 0)
if(NOT EXISTS "${_localFile}" OR _IU_DOWNLOAD_ALWAYS)
Expand Down Expand Up @@ -369,11 +360,6 @@ macro(INCLUDE_URL _remoteFile)
endif()
endif()

# Download is finished, we can now release the lock
if(NOT CMAKE_VERSION VERSION_LESS 3.2)
file(LOCK "${_lockFile}" RELEASE)
endif()

if(NOT EXISTS "${_localFile}" AND NOT _IU_OPTIONAL)
message(FATAL_ERROR "Downloaded file does not exist. Please report this as a bug")
endif()
Expand Down

0 comments on commit 151bb2b

Please sign in to comment.