microsoft / microsoft/DirectXShaderCompiler

Support -H and -P at the same time

Open
#3,863 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

The -P flag runs the dxc preprocessor.
The -H flag outputs a list of all headers included. (there is also a similar-Vi option)

The -H flag is only available when running a regular dxc build.
It is not available when running only the preprocessor.

This strikes me as odd, because as far as I can tell, the information that -H produces come from the preprocessor, not from the build. The preprocessor must know about all the includes to do its job.

I am personally in a situation where I only use dxc as a preprocessor, and I need to obtain the list of included headers. I have no way of doing so without running a full build, or manually parsing the preprocessed output.

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

The issue identifies the dxc -H and -P command-line options but names no source files or tests. Start by tracing how dxc handles these options, then verify that preprocessing alone can emit the included-header list when both flags are supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.