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

Enable CMake Unity build for Android #2932

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

Conversation

louwers
Copy link
Collaborator

@louwers louwers commented Oct 14, 2024

When this property is set to true, the target source files will be combined into batches for faster compilation. This is done by creating a (set of) unity sources which #include the original sources, then compiling these unity sources instead of the originals. This is known as a Unity or Jumbo build.

https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html

Experiment to allow for making unity builds with CMake. This has the potential to significantly speed up build times.

Edit: looks like for Android libmaplibre.so compilation time goes from 2m 6s to 53s.

@ntadej
Copy link
Collaborator

ntadej commented Oct 14, 2024

Can you maybe provide a bit of a description what is that and why is it useful? 😊

@louwers
Copy link
Collaborator Author

louwers commented Oct 14, 2024

@ntadej Yeah I just opened it to see if it builds. 🙈

@louwers louwers marked this pull request as draft October 14, 2024 17:05
Copy link

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +264  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2932-compared-to-main.txt

Copy link

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.0% -20.6Ki  -0.0% -7.17Ki    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2932-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +28% +32.6Mi  +426% +25.4Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2932-compared-to-legacy.txt

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.

2 participants