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

Added arm64 Windows build output for FreeImage dependency #10

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

timojch
Copy link

@timojch timojch commented Jan 15, 2025

FreeImage is used by the mgcb task to pack images into xnb content packages. It doesn't currently support arm64, which means that some notebook computers (GalaxyBook, some recent Surface products, etc.) aren't able to build MonoGame projects. This PR adds arm64 support for the FreeImage dependency, which is one step in the road to supporting these devices.

Added an arm64 configuration to the freeimage submodule

I added an arm64 configuration to the vs2017 solution and project files. for The build rules were copied verbatim from the x64, except that RandomizedBaseAddress had to be set to true as arm64 doesn't support otherwise. Additionally, I had to change the #define check in infsimd.h to avoid including mmintrin.h on arm64, and it's not supported.

Added an arm64 output to BuildWindowsTask.cs

I modified BuildWindowsTask.cs to create an additional build output for arm64. The previous x64 DLL is now copied to a subfolder, which will be a slight compatibility break. Let me know if there's a better way to d othis.

Testing

I have verified that if I manually copy the arm64 FreeImage.dll built with these changes into a local copy of the dotnet-mgcb package, I the mgcb task builds a content pack containing images on my GalaxyBook. Additionally, I have verified that it continues to produce the same output in its x64 folder after the change as it did before.

Expected Impact

There will not be any end-product features enabled by this PR alone. The remaining work is:

  • Ensure all other mgcb dependencies (e.g. for music, sounds, spritefonts) also build arm64 outputs.
  • Modify dotnet-mgcb to be the architecture-aware and use the right dependencies.

After that, it will be possible to build (but not modify) mgcb files on arm64 devices.

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.

1 participant