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

Universal macOS ARM64 binary and statically compiled FreeType #239

Merged
merged 10 commits into from
Aug 7, 2024

Conversation

SpaiR
Copy link
Owner

@SpaiR SpaiR commented Aug 6, 2024

Description

This PR revises the approach to supporting ARM64 architecture introduced in #223. Instead of building separate dylib files for different architectures, the CI will now compile a universal library that works on both x86_64 and ARM64 architectures.

Additionally, the integration process with the FreeType library has been reworked. FreeType is now enabled by default (the define IMGUI_ENABLE_FREETYPE is used during compilation). The library is compiled into the binding statically. This addresses a previous issue where Linux/macOS users experienced application crashes due to a missing library on their system.

As a result, the bin/freetype folder has been entirely removed due to its redundancy. In future releases, versions with the -ft suffix will no longer be provided. The library will always be released with FreeType included.

On a smaller scale, the CI has been reworked and its actions updated. The build process should now be slightly faster overall.


Relates:

resolves #215
resolves #216

Type of change

  • Minor changes or tweaks (quality of life stuff)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

- Static FreeType linking flow for all OS
- Flow to build universal binaries for macOS (x86_64, aarch64)
- Simplified CI workflow by removing FreeType branches from the build matrix

Added 2 new scripts:
1. `buildSrc/scripts/vendor_freetype.sh`
2. `buildSrc/scripts/build.sh`

The first script prepares FreeType for usage in the build process.
The result of this script is used in the `GenerateLibs` task.
Other ways of building with FreeType are removed.
If it's impossible to build with FreeType, it is recommended to set `freetype=false`.

The second script aggregates commands to build native binaries.
It includes specific steps, such as creating a universal library for macOS and copying the result to the specific folder `/tmp/imgui/dst`.

Script 1 can be used for local builds. Script 2 is primarily intended for use in CI.
@SpaiR SpaiR added feat New feature or request github_actions labels Aug 6, 2024
@SpaiR SpaiR self-assigned this Aug 6, 2024
@SpaiR SpaiR changed the title build(binding): streamline build process Draft: build(binding): streamline build process Aug 6, 2024
@SpaiR SpaiR force-pushed the build/streamline-native-buidls branch from 7066ec2 to 0d6f54f Compare August 6, 2024 15:06
@SpaiR SpaiR force-pushed the build/streamline-native-buidls branch from 0d6f54f to 67699a8 Compare August 6, 2024 15:12
@SpaiR SpaiR changed the title Draft: build(binding): streamline build process Universal macOS ARM64 binary and statically compiled FreeType Aug 6, 2024
@SpaiR SpaiR merged commit 84fec71 into main Aug 7, 2024
7 checks passed
@SpaiR SpaiR deleted the build/streamline-native-buidls branch August 7, 2024 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant