Skip to content

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