1

for example, I'm using CMake to build. But the toolchain arg is configured in setting.json, so when I switch to WSL from Windows, I have to change the directory so that CMake can find the right toolchain file.

"cmake.configureArgs": [
    // "-DCMAKE_TOOLCHAIN_FILE=/home/isudfv/vcpkg/scripts/buildsystems/vcpkg.cmake"
    "-DCMAKE_TOOLCHAIN_FILE=C:\\Program Files\\Vcpkg\\scripts\\buildsystems\\vcpkg.cmake",
    "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
]
isudfv
  • 179
  • 1
  • 9

1 Answers1

0

You can use project_options, which automatically installs vcpkg in a cross-platform way.

To do this manually, install vcpkg in an os-agnostic path like ~/vcpkg.

Amin Ya
  • 1,515
  • 1
  • 19
  • 30