Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,24 @@ function(_vcpkg_tool_bootstrap vcpkg_root)
RESULT_VARIABLE result)

if(NOT result EQUAL "0")
message(FATAL_ERROR "${bootstrap_cmd} failed with ${result}")
if(CMAKE_HOST_UNIX)
message(STATUS "Retry to build vcpkg from source...")
set(bootstrap_impl "${vcpkg_root}/scripts/bootstrap.sh")
file(READ "${bootstrap_impl}" file_contents)
string(REPLACE [[elif [ "$ARCH" = "x86_64" ]; then]]
[[elif [ "$ARCH" = "" ]; then]] file_contents
"${file_contents}")
file(WRITE "${bootstrap_impl}" "${file_contents}")

execute_process(
COMMAND ${bootstrap_cmd} -disableMetrics
WORKING_DIRECTORY ${vcpkg_root}
RESULT_VARIABLE result)
endif()

if(NOT result EQUAL "0")
message(FATAL_ERROR "${bootstrap_cmd} failed with ${result}")
endif()
endif()
endfunction()

Expand Down