Skip to content

Reduce build times: break framework/apps dependency cycle and add shared PCH - #1601

Open
gpx1000 wants to merge 3 commits into
KhronosGroup:mainfrom
gpx1000:fix/long-build-times
Open

gpx1000 wants to merge 3 commits into
KhronosGroup:mainfrom
gpx1000:fix/long-build-times

Conversation

@gpx1000

@gpx1000 gpx1000 commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reduces build times by breaking the dependency cycle between the
framework, plugins, apps and samples, and by adding a shared
precompiled header.

Changes

  1. Break the cycle
    • AppInfo/SampleInfo move to framework/platform/app_info.h.
    • Android JNI getSamples() moves to app/android/sample_list_jni.cpp.
    • The framework no longer links plugins or inherits their include dirs.
    • apps links samples PRIVATE; plugins uses normal target links.
  2. Shared PCH (VKB_USE_PCH, default ON)
    • framework/common/pch.h, owned by the framework and reused by
      samples, apps and plugins.
    • TUs that define *_IMPLEMENTATION macros opt out.
  3. The spirv-cross CLI and unused backends are no longer built by default.

Measurements

Linux, clang, 24 threads, ccache off, shaders off, full rebuild:

CPU before CPU after Wall before Wall after
Release 82.9 min 38.5 min 3m52s 1m52s
Debug 67.3 min 24.1 min 3m14s 1m22s

Median -I flags per TU: 247 -> 9. Windows is not measured.

Break the framework -> plugins -> apps -> samples -> framework cycle,
which put every sample's include directories on every compile command,
and add a shared precompiled header (VKB_USE_PCH, default ON) reused by
the framework, samples, apps and plugins.
@gpx1000 gpx1000 linked an issue Nov 16, 2026 that may be closed by this pull request
@gpx1000
gpx1000 requested a review from a team November 17, 2026 16:31

This branch has not been deployed

No deployments
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.

Extremely long build times

1 participant