mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-19 17:08:06 +08:00
7d2449c346
* [docs] Delete embedded documentation in favor of docs/ Drive-by for the helper ports: 1. "documentation": "https://vcpkg.io/en/docs/README.html" 2. "license": "MIT" 3. Use `include_guard(GLOBAL)` in all script files 4. Make sure any persistent variables are saved to the cache * [docs] Restore empty regenerate.ps1 to satisfy Azure Pipelines * [docs] PR comments
41 lines
1.4 KiB
CMake
41 lines
1.4 KiB
CMake
function(z_vcpkg_clean_executables_in_bin_remove_directory_if_empty directory)
|
|
if(NOT EXISTS "${directory}")
|
|
return()
|
|
endif()
|
|
|
|
if(NOT IS_DIRECTORY "${directory}")
|
|
message(FATAL_ERROR "${directory} must be a directory")
|
|
endif()
|
|
|
|
file(GLOB items "${directory}/*")
|
|
if("${items}" STREQUAL "")
|
|
file(REMOVE_RECURSE "${directory}")
|
|
endif()
|
|
endfunction()
|
|
|
|
|
|
function(vcpkg_clean_executables_in_bin)
|
|
cmake_parse_arguments(PARSE_ARGV 0 arg "" "" "FILE_NAMES")
|
|
|
|
if(NOT DEFINED arg_FILE_NAMES)
|
|
message(FATAL_ERROR "FILE_NAMES must be specified.")
|
|
endif()
|
|
|
|
if(DEFINED arg_UNPARSED_ARGUMENTS)
|
|
message(WARNING "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
|
|
endif()
|
|
|
|
|
|
foreach(file_name IN LISTS arg_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()
|
|
|
|
z_vcpkg_clean_executables_in_bin_remove_directory_if_empty("${CURRENT_PACKAGES_DIR}/bin")
|
|
z_vcpkg_clean_executables_in_bin_remove_directory_if_empty("${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
endfunction()
|