[vcpkg] Convert env vars slash if host is Win32 (#16927)

This commit is contained in:
huangqinjin 2021-04-08 04:17:04 +08:00 committed by GitHub
parent 7c89056c07
commit 2e35636a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ foreach(VAR IN LISTS VCPKG_VARS_TO_CHECK)
endforeach() endforeach()
foreach(_env IN LISTS VCPKG_ENV_VARS_TO_CHECK) foreach(_env IN LISTS VCPKG_ENV_VARS_TO_CHECK)
IF(WIN32) if(CMAKE_HOST_WIN32)
string(REPLACE "\\" "/" ENV_${_env} "$ENV{${_env}}") string(REPLACE "\\" "/" ENV_${_env} "$ENV{${_env}}")
string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_ENV_${_env} \"${ENV_${_env}}\")\n") string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_ENV_${_env} \"${ENV_${_env}}\")\n")
else() else()