Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

osdep/dirent: add implementation for Windows SDK build and other minor changes #14038

Merged
merged 23 commits into from May 6, 2024

Conversation

kasper93
Copy link
Contributor

@kasper93 kasper93 commented May 1, 2024

No description provided.

Copy link

github-actions bot commented May 1, 2024

Download the artifacts for this pull request:

Windows
macOS

@sfan5
Copy link
Member

sfan5 commented May 2, 2024

What is "Windows SDK build" referring to here? UWP?

@kasper93
Copy link
Contributor Author

kasper93 commented May 2, 2024

What is "Windows SDK build" referring to here? UWP?

I'm targeting clang x86_64-pc-windows-msvc, basically native Windows build without mingw dependency and using Windows SDK headers instead. There will be more changes, but first batch, can be reviewed.

meson.build Show resolved Hide resolved
osdep/compiler.h Show resolved Hide resolved
@sfan5
Copy link
Member

sfan5 commented May 2, 2024

I'm targeting clang x86_64-pc-windows-msvc

Last time someone tried to make some syntax changes (IIRC it was something about varargs macros) to fix the build on MSVC wm4 thought it was stupid and rejected the PR. This was years ago, of course.
clang-cl might be okay since that's a more modern compiler but I tend to agree that having to avoid <unistd.h> in what is otherwise portable code is a bit annoying.

Edit: I mistook clang-cl for what this PR actually does.

@kasper93
Copy link
Contributor Author

kasper93 commented May 2, 2024

MSVC wm4 thought it was stupid and rejected the PR.

Supporting cl or clang-cl would be insanely stupid, there would be very awkward changes/workarounds to support it. But nowadays clang with GNU driver fully supports Windows and there is no reason to not provide such build. I have some more changes, but none of them are really painful. Else I wouldn't push forward with it. Except maybe dirent thing itself, but it is only one big change that has to be included.

I tend to agree that having to avoid <unistd.h> in what is otherwise portable code is a bit annoying.

I see, but in practice if it is in common.h it shouldn't be a problem. Minor inconvenience at best imo.

EDIT:

Just to give a context mpv is a bad egg that do not actually support building with Windows SDK. libass, ffmpeg, libplacebo all support it. lua, mujs and others too, but for now I'm working on bare bones build. lua has meson wraps for >=5.3 and we are supporting up to 5.2, but this is a topic for future me.

@ruihe774
Copy link
Contributor

ruihe774 commented May 2, 2024

lua has meson wraps for >=5.3 and we are supporting up to 5.2, but this is a topic for future me.

LuaJIT and other dependencies are in vcpkg. Giving meson can read cmake packages, the easier way is to build mpv with vcpkg packages, I think.

@kasper93
Copy link
Contributor Author

kasper93 commented May 2, 2024

Thank you for suggestion, but it is not in the scope for now. I will do it, when the time comes.

@kasper93
Copy link
Contributor Author

kasper93 commented May 2, 2024

Not sure what you want to say, but works for me.

@kasper93
Copy link
Contributor Author

kasper93 commented May 2, 2024

I don't need it, thank you.

@kasper93
Copy link
Contributor Author

kasper93 commented May 3, 2024

Updated with the rest of the changes and ci build. This PR is finished. I have some changes to add lua, spirv-cross, shaderc, but his is for next PR.

@kasper93 kasper93 requested a review from na-na-hi May 3, 2024 16:01
.github/workflows/comment.yml Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
player/configfiles.c Show resolved Hide resolved
stream/stream_file.c Show resolved Hide resolved
@kasper93
Copy link
Contributor Author

kasper93 commented May 5, 2024

I will merge tomorrow if there are no objections. I think the changes are not that scary.

@kasper93
Copy link
Contributor Author

kasper93 commented May 6, 2024

Changed libmpv build to shared and added to artifacts. Might be useful to some.

EDIT: Not really, because it currently is awkward to build shared library with all subprojects build as static one. So to make it not bloated, leave as is. Meson changes for this are discussed here mesonbuild/meson#13086 (comment) I will revisit idea of shipping libmpv.so once those are merged.

@kasper93 kasper93 force-pushed the win32_p1 branch 2 times, most recently from 8006a5f to f0a9122 Compare May 6, 2024 19:25
x86_64-pc-windows-msvc build without mingw dependency. For now it lacks
some key dependencies like lua or shaderc. Will be extended in the
future.
@kasper93 kasper93 merged commit 425c6d0 into mpv-player:master May 6, 2024
17 checks passed
@kasper93 kasper93 deleted the win32_p1 branch May 6, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants