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

CMake: Define gammaray_pch_core_gui as an INTERFACE library #940

Closed
wants to merge 1 commit into from

Conversation

Kentzo
Copy link
Contributor

@Kentzo Kentzo commented Jan 24, 2024

INTERFACE avoids actual compilation and more complex dependency relation of a STATIC library.

An INTERFACE library avoids actual compilation and more complex
dependency relation of a STATIC library.
@Kentzo Kentzo changed the title CMake: Define gammaray_pch_core_gui as INTERFACE CMake: Define gammaray_pch_core_gui as an INTERFACE library Jan 24, 2024
@Waqar144
Copy link
Contributor

This will make every target have its own PCH resulting in a build that is slower than non-pch build plus a massive increase in the build dir size.

@Kentzo
Copy link
Contributor Author

Kentzo commented Jan 25, 2024

Thank you for taking a look.

I was inspired by the following excerpt from the target_precompile_headers doc:

A notable exception to this is where an interface library is created to define a commonly used set of precompile headers in one place and then other targets link to that interface library privately. In this case, the interface library exists specifically to propagate the precompile headers to its consumers and the consumer is effectively still in control, since it decides whether to link to the interface library or not.

Comparison of running times of GitHub Actions suggests that the compilation time indeed increased. E.g. https://github.com/KDAB/GammaRay/actions/runs/7637161294/job/20805489439?pr=941 vs https://github.com/KDAB/GammaRay/actions/runs/7645378040/job/20831803946?pr=940.

I will investigate further.

@Kentzo
Copy link
Contributor Author

Kentzo commented Jan 27, 2024

You were correct, I misunderstood the doc.

@Kentzo Kentzo closed this Jan 27, 2024
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.

None yet

2 participants