We usually avoid the WSL default of putting the full Windows PATH into WSL. Particularly when using a build system like CMake, there will be Windows libraries that WSL-based CMake thinks it can use that it actually can’t. There are a lot of StackExchange questions on this topic as well.
Edit file /etc/wsl.conf inside the WSL distro:
[interop] enabled=false appendWindowsPath=false