aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-08-08 14:26:10 +0200
committerJakub Konka <kubkon@jakubkonka.com>2022-08-08 14:26:10 +0200
commita0ec07fdec9efb8364394ad12b4000a9072ed59f (patch)
tree6343a17dd7d77ea21d431a4df9a7309154335a0f /src
parent80c9d3f3b13a5e88a4103582f406a698fa8643d1 (diff)
downloadzig-a0ec07fdec9efb8364394ad12b4000a9072ed59f.tar.gz
zig-a0ec07fdec9efb8364394ad12b4000a9072ed59f.zip
cc: add support for -M flag
Diffstat (limited to 'src')
-rw-r--r--src/clang_options_data.zig13
-rw-r--r--src/main.zig5
2 files changed, 13 insertions, 5 deletions
diff --git a/src/clang_options_data.zig b/src/clang_options_data.zig
index d4320b1619..76e687c7d6 100644
--- a/src/clang_options_data.zig
+++ b/src/clang_options_data.zig
@@ -33,7 +33,14 @@ flagpd1("H"),
.psl = false,
},
flagpd1("I-"),
-flagpd1("M"),
+.{
+ .name = "M",
+ .syntax = .flag,
+ .zig_equivalent = .dep_file_to_stdout,
+ .pd1 = true,
+ .pd2 = false,
+ .psl = false,
+},
.{
.name = "MD",
.syntax = .flag,
@@ -53,7 +60,7 @@ flagpd1("M"),
.{
.name = "MM",
.syntax = .flag,
- .zig_equivalent = .dep_file_mm,
+ .zig_equivalent = .dep_file_to_stdout,
.pd1 = true,
.pd2 = false,
.psl = false,
@@ -1983,7 +1990,7 @@ flagpsl("MT"),
.{
.name = "user-dependencies",
.syntax = .flag,
- .zig_equivalent = .dep_file_mm,
+ .zig_equivalent = .dep_file_to_stdout,
.pd1 = false,
.pd2 = true,
.psl = false,
diff --git a/src/main.zig b/src/main.zig
index f192137b3c..0c6e4a63a3 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1657,7 +1657,8 @@ fn buildOutputType(
disable_c_depfile = true;
try clang_argv.appendSlice(it.other_args);
},
- .dep_file_mm => { // -MM
+ .dep_file_to_stdout => { // -M, -MM
+ // "Like -MD, but also implies -E and writes to stdout by default"
// "Like -MMD, but also implies -E and writes to stdout by default"
c_out_mode = .preprocessor;
disable_c_depfile = true;
@@ -4652,7 +4653,7 @@ pub const ClangArgIterator = struct {
lib_dir,
mcpu,
dep_file,
- dep_file_mm,
+ dep_file_to_stdout,
framework_dir,
framework,
nostdlibinc,