How to do cross platform build for Linux target on Windows build system without even WSL.

I am doing some POC where in I need to build for linux target on Windows build system **without ** even WSL. So what I want to do is below.

  1. Build for Linux target on windows build system
  2. Take the build executable and copy it to Linux/ Ubuntu machines and should be able to run.

I know cmake supports cross-platform builds. But could not find out from where I will get Linux related libraries/so (Linux environment) to build my target.

Any help would be greatly appreciated.

Visual Studio supports building on Windows for Linux. However, it requires either a remote SSH Linux machine connection, or using WSL on the local computer.

It seems you might want an offline build instead. There are old Cygwin posts about doing this. People have asked about doing this with MSYS2 but I haven’t seen an exact procedure.

If perhaps none of those are suitable, I would consider CI/CD (like GitHub Actions or many other online and offline choices) where when the developer Git pushes, the server/worker job provides binaries across operating systems. That would be a general way to accomplish such tasks repeatably, although quite distinct from your POC.

An example of this is the Ninja project, where they provide old (CentOS 7) binaries and other operating systems. This could easily be extended to ARM etc. ninja/.github/workflows/linux.yml at master · ninja-build/ninja · GitHub
If you need offline then Jenkins or similar can do this.