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

Manually specify build tools #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TCROC
Copy link

@TCROC TCROC commented Oct 13, 2024

This was done for the same reasons as this PR for godot: godotengine/godot#91743

Currently Godot overrides build tools such as CC and CXX depending on which platform is being targeted. This adds a boolean to the build process that prevents this from happening. It helps solve a lot of the pain points that I have been running into in the godot-src project: https://github.com/lange-studios/godot-src

This allows me to more easily use zig and other tools for cross compilation. Example:

  "CC=zig cc -target x86_64-linux-gnu"
  "CXX=zig c++ -target x86_64-linux-gnu"
  "LINK=zig c++ -target x86_64-linux-gnu"
  "AS=zig c++ -target x86_64-linux-gnu"
  "AR=zig ar"
  "RANLIB=zig ranlib"
  "WINDRES=zig rc"

And just like that, I can compile godot from any platform zig supports compiling from to any platform zig supports compiling to! In this case from Windows, Mac, or Linux to Linux! :)

I'm still testing out things as we build our own game with this tool to different platforms. So far it is working good! I'll leave it in draft state while I test things a little more and see what other changes I may need to make to the build process. I'm doing my best to keep the changes as small as possible. Please feel free to leave any feedback in the meantime.

Another thing to note:

zig handles the linking of libatomic (or so it seems in my tests) so I added a boolean to prevent that from being linked as well. I have set the default values to mirror exactly how godot currently behaves so as to avoid any breaking changes for existing build processes.

Let me know if there is anything you would like changed :). Thanks for the awesome tool! :)

@Calinou Calinou added the enhancement New feature or request label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants