Skip to content

expand response file for subtool commands#2702

Open
moritzx22 wants to merge 2 commits intoninja-build:masterfrom
moritzx22:commands_response
Open

expand response file for subtool commands#2702
moritzx22 wants to merge 2 commits intoninja-build:masterfrom
moritzx22:commands_response

Conversation

@moritzx22
Copy link
Copy Markdown
Contributor

@moritzx22 moritzx22 commented Dec 27, 2025

Related PRs

#1760 #2698

Problem description and current master branch

Ninja does not expand response files in the subtool commands.

# build.ninja
rule cc
  command = gcc @${out}.rsp -o ${out}
  rspfile = ${out}.rsp
  rspfile_content = -Iinclude -O2 $in

build myprog: cc file1.c file2.c file3.c
$ninja -t commands
gcc @myprog.rsp -o myprog

Proposed Solution

$ninja -t commands -x
gcc -Iinclude -O2 file1.c file2.c file3.c -o myprog

option or default

#1760 (comment)
This can be done as the default without a flag, but to be consistent with compdb I used the flag -x

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.

1 participant