diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-12-21 03:47:02 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-12-21 03:47:02 -0800 |
| commit | 5e5506e68a9657d18bc4fb4380b5b4dfc849c019 (patch) | |
| tree | c101f6e1d7b00dbda744eb53dbe8b2db9d9fac8e /scripts/cmake | |
| parent | 9491c607435fb349b255f0423dd7a6239a2dd002 (diff) | |
| download | vcpkg-5e5506e68a9657d18bc4fb4380b5b4dfc849c019.tar.gz vcpkg-5e5506e68a9657d18bc4fb4380b5b4dfc849c019.zip | |
[vcpkg-download-distfile] Add input sanitization
Diffstat (limited to 'scripts/cmake')
| -rw-r--r-- | scripts/cmake/vcpkg_download_distfile.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index b22d82a16..24503338a 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -39,6 +39,16 @@ function(vcpkg_download_distfile VAR) set(multipleValuesArgs URLS) cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) + if(NOT DEFINED vcpkg_download_distfile_URLS) + message(FATAL_ERROR "vcpkg_download_distfile requires a URLS argument.") + endif() + if(NOT DEFINED vcpkg_download_distfile_FILENAME) + message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") + endif() + if(NOT DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument.") + endif() + set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) set(download_file_path_part "${DOWNLOADS}/temp/${vcpkg_download_distfile_FILENAME}") |
