diff --git a/ports/vcpkg-cmake/cmake_get_vars/CMakeLists.txt b/ports/vcpkg-cmake/cmake_get_vars/CMakeLists.txt index 51f6357c7c..fb1da46965 100644 --- a/ports/vcpkg-cmake/cmake_get_vars/CMakeLists.txt +++ b/ports/vcpkg-cmake/cmake_get_vars/CMakeLists.txt @@ -143,9 +143,12 @@ foreach(incdir IN LISTS CMAKE_C_STANDARD_INCLUDE_DIRECTORIES) endforeach() foreach(flag CXX C SHARED_LINKER EXE_LINKER STATIC_LINKER RC) - if(MSVC) - # Transform MSVC /flags to -flags due to bash scripts intepreting /flag as a path. - # This is imperfect because it fails on directories with trailing spaces, but those are exceedingly rare + # When using MSVC, maybe transform /flags to -flags. + # When cross compiling, "/flags" may be an absolute path starting with /, so don't transform. + # Otherwise, transform to improve compatibility with scripts interpreting "/flags" as a path. + if(MSVC AND "${CMAKE_HOST_SYSTEM_NAME}" MATCHES "Windows") + # This implementation is imperfect because it fails on directories with trailing spaces, + # but those are rare. string(REGEX REPLACE "(^| )/" "\\1-" ${flag}_FLAGS "${${flag}_FLAGS}") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") if("${flag}" STREQUAL "CXX") diff --git a/ports/vcpkg-cmake/vcpkg.json b/ports/vcpkg-cmake/vcpkg.json index c888fc8729..3c3cebde55 100644 --- a/ports/vcpkg-cmake/vcpkg.json +++ b/ports/vcpkg-cmake/vcpkg.json @@ -1,5 +1,5 @@ { "name": "vcpkg-cmake", - "version-date": "2022-05-05", + "version-date": "2022-05-06", "license": "MIT" } diff --git a/versions/baseline.json b/versions/baseline.json index 6618781882..2b1f11e29d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7317,7 +7317,7 @@ "port-version": 1 }, "vcpkg-cmake": { - "baseline": "2022-05-05", + "baseline": "2022-05-06", "port-version": 0 }, "vcpkg-cmake-config": { diff --git a/versions/v-/vcpkg-cmake.json b/versions/v-/vcpkg-cmake.json index bb8b094fab..ecc5876cd2 100644 --- a/versions/v-/vcpkg-cmake.json +++ b/versions/v-/vcpkg-cmake.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "46a5686341cf9136053ff01b9f213dbd2dbea8a6", + "version-date": "2022-05-06", + "port-version": 0 + }, { "git-tree": "ecfb2282f599a9c1f3a9ad98eac9d2b35690850f", "version-date": "2022-05-05",