Skip to content

CMake: Define gammaray_pch_core_gui as an INTERFACE library#940

Closed
Kentzo wants to merge 1 commit into
KDAB:masterfrom
Kentzo:pch-as-interface
Closed

CMake: Define gammaray_pch_core_gui as an INTERFACE library#940
Kentzo wants to merge 1 commit into
KDAB:masterfrom
Kentzo:pch-as-interface

Conversation

@Kentzo

@Kentzo Kentzo commented Jan 24, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Kentzo commented Jan 25, 2024

Copy link
Copy Markdown
Contributor Author

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

Kentzo commented Jan 27, 2024

Copy link
Copy Markdown
Contributor Author

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.

2 participants