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

speedup compilation with help of cmake 3.6 pch support #13581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dushistov
Copy link
Contributor

Since cmake 3.16 there is cross-platform support of precompiled
headers in cmake. So I add code to check version of cmake,
and if it is recent enough build system switches to cmake's pch
support.

I tested with such command:
touch qt/main.cpp && time ninja MAPS.ME
Before: ~ 35 seconds on my machine (average)
After: ~ 21 seconds (average)

What make this speedup possible:

  1. With cmake's pch support generation of precompiled headers
    happens only if something changed, while current PCH script cause
    recompilation of headers every run of ninja. It takes ~ 4 seconds
  2. Now it is possible to set precompiled headers per target,
    and I include map/framework.hpp for "qt".

Since cmake 3.16 there is cross-platform support of precompiled
headers in cmake. So I add code to check version of cmake,
and if it is recent enough build system switches to cmake's pch
support.

I tested with such command:
touch qt/main.cpp && time ninja MAPS.ME
Before: ~ 35 seconds on my machine (average)
After: ~ 21 seconds

What make this speedup possible:
1. With cmake's pch support generation of precompiled headers
  happens only if something changed, while current PCH script cause
  recompilation of headers every run of ninja. It takes ~ 4 seconds
2. Now it is possible to set precompiled headers per target,
   and I include map/framework.hpp for "qt"
@pastk
Copy link

pastk commented Dec 19, 2021

Looks like https://github.com/organicmaps/organicmaps could benefit from this PR?

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