MusicPlayerDaemon / mpc

Command-line client for MPD
GNU General Public License v2.0
191 stars 36 forks source link

Allow compilation with MSVC #89

Closed bogglez closed 2 years ago

bogglez commented 2 years ago

Regarding the workflow, I'm not sure how the meson build script introduces the gcc compiler. To me it looks like the workflow should not have gcc available, find msvc instead, and build without issue. Where does gcc come from?

eli-schwartz commented 2 years ago

Compilers are preinstalled by Github's build images.

MaxKellermann commented 2 years ago

The new header is missing - also, can you fold the 2 commits into one? The second one removes stuff added by the first one.

bogglez commented 2 years ago

The new header is missing - also, can you fold the 2 commits into one? The second one removes stuff added by the first one.

Hi Max. I just did so. I usually squash at the end.

I added the github action and the missing header.

For the GitHub action, apparently Meson doesn't find MSVC on its own, as CMake would. Sourcing the environment variables for the MSVC terminal makes Meson find and prefer MSVC.

eli-schwartz commented 2 years ago

Meson has a --vsenv option to force looking up MSVC. By default it's not in the path and will therefore only be used when no other compiler is detected.

bogglez commented 2 years ago

Meson has a --vsenv option to force looking up MSVC. By default it's not in the path and will therefore only be used when no other compiler is detected.

Apparently this was introduced in a later meson version than is required in the workflows: https://mesonbuild.com/Release-notes-for-0-60-0.html Do you suggest bumping the meson version instead of sourcing MSVC?

eli-schwartz commented 2 years ago

Well, you're already using https://github.com/ilammy/msvc-dev-cmd to set up the env for MSVC before running Meson. This seems fine to me as well.