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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meson flag for compiling with SDL3 #3141

Merged
merged 4 commits into from
Oct 6, 2024
Merged

Add meson flag for compiling with SDL3 #3141

merged 4 commits into from
Oct 6, 2024

Conversation

ankith26
Copy link
Member

@ankith26 ankith26 commented Oct 5, 2024

Add a flag to allow compilation with SDL3. But for obvious reasons we still default to compiling with SDL2.

@ankith26 ankith26 requested a review from a team as a code owner October 5, 2024 05:44
@yunline yunline added build Compiling stuff sdl3 meson Meson build system labels Oct 5, 2024
meson.build Outdated Show resolved Hide resolved
Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, looks good! 👍

@ankith26 ankith26 marked this pull request as draft October 5, 2024 13:08
@ankith26
Copy link
Member Author

ankith26 commented Oct 5, 2024

Converting to draft because I want to do a bit more in this PR

@ankith26
Copy link
Member Author

ankith26 commented Oct 5, 2024

@ankith26 ankith26 marked this pull request as ready for review October 5, 2024 16:31
@ankith26
Copy link
Member Author

ankith26 commented Oct 5, 2024

This PR is now done from my end

@Starbuck5
Copy link
Member

With regards to the include changes, in my development I've just made sure the include path goes inside the SDL folder instead of editing every include.

@Starbuck5
Copy link
Member

Another thing I did in my branch to make this stuff compile better was -DSDL_ENABLE_OLD_NAMES=1, which is very handy.

Also because of my prior PRs several modules you've masked out in this compile, at least last time I checked (may have changed). Like key, image, base, etc.

@ankith26
Copy link
Member Author

ankith26 commented Oct 6, 2024

The latest changes have broken some of your patches. For instance, PG_SURF_BitsPerPixel/PG_SURF_BytesPerPixel is now not implementable without an extra function call and a null check.
When I tested this branch locally none of the modules could compile. But I wasn't aware of -DSDL_ENABLE_OLD_NAMES=1.

With regards to the include changes, in my development I've just made sure the include path goes inside the SDL folder instead of editing every include.

That was my first idea but it is virtually impossible to do from our end in a cross platform way (see my older comment with the link to the SDL issue).

@Starbuck5
Copy link
Member

The latest changes have broken some of your patches. For instance, PG_SURF_BitsPerPixel/PG_SURF_BytesPerPixel is now not implementable without an extra function call and a null check.

My first reaction: oh boy 😢

However-- We can use macros on the pixelformat itself, SDL_BYTESPERPIXEL and SDL_BITSPERPIXEL. Whew.

That was my first idea but it is virtually impossible to do from our end in a cross platform way (see my older comment with the link to the SDL issue).

I don't know anything about .pc files.

It makes me annoyed at meson that we don't have the freedom to do that. It seems like we should be able to add an include path to an existing dependency object, which would solve this because we could add an include path which is the old include path + "/sdl3".

@ankith26
Copy link
Member Author

ankith26 commented Oct 6, 2024

It seems like we should be able to add an include path to an existing dependency object, which would solve this because we could add an include path which is the old include path + "/sdl3".

Even if we could do that, we would probably not be able to support macOS Frameworks: for reasons I don't understand.

@Starbuck5
Copy link
Member

It's so easy on Windows with the old SETUP file that I didn't even bat an eye when I rewrote the include path.

@ankith26 ankith26 added this to the 2.5.2 milestone Oct 6, 2024
@ankith26 ankith26 merged commit 63eba62 into main Oct 6, 2024
28 checks passed
@ankith26 ankith26 deleted the sdl3_compile branch October 6, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Compiling stuff meson Meson build system sdl3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants