Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,800
    • Issues 3,800
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #19659

Closed
Open
Created Aug 29, 2019 by Steve Mokris@smokris🐢Contributor

Add ability to share precompiled headers between targets

After !3553 (merged), if I do this:

add_executable(test test.cc)
target_precompile_headers(test PUBLIC ${PROJECT_SOURCE_DIR}/common.hh)

add_executable(test2 test2.cc)
target_precompile_headers(test2 PUBLIC ${PROJECT_SOURCE_DIR}/common.hh)

…it precompiles common.hh twice, even though both targets use the same build settings and thus a single precompiled header could be shared, which would further improve build speed.

On !3553 (comment 606628), @Rogiel suggested:

It should be possible to later add a target_precompile_headers(<target> REUSE_FROM <reuse-target>).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking