microsoft / microsoft/WindowsAppSDK-Samples

"Samples\Content\cpp-win32\Squares\Squares.vcxproj" doesn't configure precompiled headers correctly

Open Beginner friendly
#271 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1k
Forks
335
Avg merge
5d 1h
Merged PRs (30d)
8

Description

"Samples\Content\cpp-win32\Squares\Squares.vcxproj" doesn't configure precompiled headers correctly, meaning that:

  1. 'pch.cpp' is compiled unnecessarily
  2. Other '.cpp' files don't benefit from precompiled headers.

Only the Debug|Win32 configuration actually specifies any precompiled header settings, and they appear to be wrong - it sets the PrecompiledHeader metadata to Create for all ClCompile items, it should be set to Use by default and Create for pch.cpp.

Without precompiled headers (i.e. as the project is currently defined) the build takes ~26 seconds on my machine. Opt-ing in to precompiled headers takes it to ~11 seconds for a full build, and incremental builds would also benefit.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open Samples\Content\cpp-win32\Squares\Squares.vcxproj and inspect its Debug|Win32 ClCompile precompiled-header settings, along with pch.cpp and the other .cpp items. Correct the default metadata so pch.cpp creates the precompiled header and other sources use it, then verify that the project builds and that full-build time improves from the reported configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.