diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-06-07 19:17:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-07 19:17:30 -0700 |
| commit | 299527f63b187ac67b1c61c72379d6c74cead59c (patch) | |
| tree | c44d658f63f96d947e8b42289f22a3e6d9da7a2b /scripts | |
| parent | ab0b48927505103c4b8782f90a44336a2bb7791d (diff) | |
| parent | 3ee46a4bb6fa2efca575ec8dee79c239c802f62a (diff) | |
| download | vcpkg-299527f63b187ac67b1c61c72379d6c74cead59c.tar.gz vcpkg-299527f63b187ac67b1c61c72379d6c74cead59c.zip | |
Merge pull request #1216 from atkawa7/patch-1
Acquire chromium depot tools
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_acquire_depot_tools.cmake | 48 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_common_functions.cmake | 3 |
2 files changed, 50 insertions, 1 deletions
diff --git a/scripts/cmake/vcpkg_acquire_depot_tools.cmake b/scripts/cmake/vcpkg_acquire_depot_tools.cmake new file mode 100644 index 000000000..1cc375725 --- /dev/null +++ b/scripts/cmake/vcpkg_acquire_depot_tools.cmake @@ -0,0 +1,48 @@ +function(vcpkg_acquire_depot_tools PATH_TO_ROOT_OUT) + set(TOOLPATH ${DOWNLOADS}/tools/depot_tools) + set(URL "https://storage.googleapis.com/chrome-infra/depot_tools.zip") + set(ARCHIVE "depot_tools.zip") + set(STAMP "initialized-depot-tools.stamp") + set(downloaded_file_path ${DOWNLOADS}/${ARCHIVE}) + + if(NOT EXISTS "${TOOLPATH}/${STAMP}") + + message(STATUS "Acquiring Depot Tools...") + + if(EXISTS ${downloaded_file_path}) + message(STATUS "Using cached ${downloaded_file_path}") + else() + if(_VCPKG_NO_DOWNLOADS) + message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") + endif() + file(DOWNLOAD ${URL} ${downloaded_file_path} STATUS download_status) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + message(STATUS "Downloading ${URL}... Failed. Status: ${download_status}") + file(REMOVE ${downloaded_file_path}) + set(download_success 0) + else() + message(STATUS "Downloading ${URL}... OK") + set(download_success 1) + endif() + + if (NOT ${download_success}) + message(FATAL_ERROR + "\n" + " Failed to download file.\n" + " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") + endif() + endif() + + + file(REMOVE_RECURSE ${TOOLPATH}) + file(MAKE_DIRECTORY ${TOOLPATH}) + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + WORKING_DIRECTORY ${TOOLPATH} + ) + file(WRITE "${TOOLPATH}/${STAMP}" "0") + message(STATUS "Acquiring Depot Tools... OK") + endif() + set(${PATH_TO_ROOT_OUT} ${TOOLPATH} PARENT_SCOPE) +endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index a0e9633c3..29f0f8dff 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -19,4 +19,5 @@ include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) -include(vcpkg_get_windows_sdk)
\ No newline at end of file +include(vcpkg_get_windows_sdk) +include(vcpkg_acquire_depot_tools) |
