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 platform macros #1188

Merged
merged 1 commit into from
Jul 31, 2023
Merged

Conversation

adamscott
Copy link
Member

@adamscott adamscott commented Jul 22, 2023

Add platform macros, like LINUX_ENABLED and UNIX_ENABLED on Linux, MACOS_ENABLED, UNIX_ENABLED, COREAUDIO_ENABLED, COREMIDI_ENABLED on macos, and WINDOWS_ENABLED, WASAPI_ENABLED, WINMIDI_ENABLED on Windows.

@adamscott adamscott added enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup labels Jul 22, 2023
@adamscott adamscott requested a review from a team as a code owner July 22, 2023 12:48
SConstruct Outdated Show resolved Hide resolved
@dsnopek
Copy link
Collaborator

dsnopek commented Jul 22, 2023

Thanks! I haven't had a chance to do a proper review yet, but I think this is a great idea

Copy link
Contributor

@Faless Faless left a comment

Choose a reason for hiding this comment

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

Please move the flags to the dedicated platform tools in tools, inside the generate function.
These are the "equivalent" of upstream Godot configure functions inside platform/name/detect.py:

  • tools/windows.py
  • tools/linux.py
  • tools/macos.py
  • tools/ios.py
  • etc.

This will also simplify the code as you can just add the flags there without having to check for the env["platform"] variables (the generate function is called only when the given platform is selected).

@adamscott
Copy link
Member Author

Please move the flags to the dedicated platform tools in tools, inside the generate function.

Yes, I saw this yesterday, but didn't have time to change it. Thanks, will do.

@adamscott adamscott force-pushed the add-platform-macros branch from 5fe73f2 to e1c68e2 Compare July 23, 2023 17:41
@adamscott adamscott requested a review from Faless July 23, 2023 17:42
@adamscott adamscott force-pushed the add-platform-macros branch from e1c68e2 to 2127a7d Compare July 23, 2023 18:41
Copy link
Contributor

@Faless Faless left a comment

Choose a reason for hiding this comment

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

See my 2 comments, I will open a separate PR to merge the osxcross tools and reduce confusion.

tools/ios_osxcross.py Outdated Show resolved Hide resolved
tools/macos_osxcross.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Faless Faless left a comment

Choose a reason for hiding this comment

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

This looks good now 👍 .
The only thing I'm not sure about is having COREAUDIO_ENABLED, COREMIDI_ENABLED on ios/macos, and WASAPI_ENABLED, WINMIDI_ENABLED on windows.

Why are they useful? I think those are there to control godot driver internals, and if they can't be disabled on those platforms, then extensions could just check for WINDOWS_ENABLED/MACOS_ENABLED.

@adamscott adamscott force-pushed the add-platform-macros branch from f6098c1 to 9d9f427 Compare July 23, 2023 23:23
@adamscott
Copy link
Member Author

@Faless I just removed the non-platform related macros!

Copy link
Collaborator

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

Thanks!

This looks great to me. I did a quick test, and I can see the Linux defines showing up as expected.

@dsnopek dsnopek merged commit 494b516 into godotengine:master Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants