Skip to content
GitLab
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 4,108
    • Issues 4,108
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and 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
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #21827
Closed
Open
Issue created Feb 17, 2021 by John Melas@johnmelasContributor

VS: CMake 3.20.0-rc1 breaks per-language PCH

My project uses this line target_precompile_headers(${APP_PROJECT} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${pch}>") which means I want only .cpp files to use precompiled headers. My project has a few .c files. Since CMake 3.20 those files are now using precompiled headers!

Additional problems: as a workaround I added precompiled headers also for C language and the problem was gone. However MSVC now emits warning 4206 about empty translation unit for file cmake_pch.c

I am using MSVC 16.8.5

Edited Feb 18, 2021 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking