[vcpkg] copy tools pdb if they exist. (#14396)

This commit is contained in:
Alexander Neumann 2020-11-06 03:16:47 +01:00 committed by GitHub
parent f754a36589
commit 5eae413e9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -26,10 +26,12 @@ function(vcpkg_clean_executables_in_bin)
message(FATAL_ERROR "FILE_NAMES must be specified.")
endif()
foreach(file_name ${_vct_FILE_NAMES})
foreach(file_name IN LISTS _vct_FILE_NAMES)
file(REMOVE
"${CURRENT_PACKAGES_DIR}/bin/${file_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
"${CURRENT_PACKAGES_DIR}/debug/bin/${file_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
"${CURRENT_PACKAGES_DIR}/bin/${file_name}.pdb"
"${CURRENT_PACKAGES_DIR}/debug/bin/${file_name}.pdb"
)
endforeach()

View File

@ -34,24 +34,27 @@ function(vcpkg_copy_tools)
endif()
if(NOT DEFINED _vct_SEARCH_DIR)
set(_vct_SEARCH_DIR ${CURRENT_PACKAGES_DIR}/bin)
set(_vct_SEARCH_DIR "${CURRENT_PACKAGES_DIR}/bin")
elseif(NOT IS_DIRECTORY ${_vct_SEARCH_DIR})
message(FATAL_ERROR "SEARCH_DIR ${_vct_SEARCH_DIR} is supposed to be a directory.")
endif()
foreach(tool_name ${_vct_TOOL_NAMES})
foreach(tool_name IN LISTS _vct_TOOL_NAMES)
set(tool_path "${_vct_SEARCH_DIR}/${tool_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
if(EXISTS ${tool_path})
file(COPY ${tool_path} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})
set(tool_pdb "${_vct_SEARCH_DIR}/${tool_name}.pdb")
if(EXISTS "${tool_path}")
file(COPY "${tool_path}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
else()
message(FATAL_ERROR "Couldn't find this tool: ${tool_path}.")
endif()
if(EXISTS "${tool_pdb}")
file(COPY "${tool_pdb}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
endif()
endforeach()
if(_vct_AUTO_CLEAN)
vcpkg_clean_executables_in_bin(FILE_NAMES ${_vct_TOOL_NAMES})
endif()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
endfunction()