aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-01-11 18:41:26 +0100
committerGitHub <noreply@github.com>2022-01-11 12:41:26 -0500
commit6d9c02a54fc847e9bed3096f910e03babec63acb (patch)
tree5c017906f23031ec47fc0056978f6901814d8ff6 /src
parent48731ccea9007529324e555ac9f24277d28c0d74 (diff)
downloadzig-6d9c02a54fc847e9bed3096f910e03babec63acb.tar.gz
zig-6d9c02a54fc847e9bed3096f910e03babec63acb.zip
zig cc: integration with sysroot arg (#10568)
Prior to this change, even if the use specified the sysroot on the compiler line like so ``` zig cc --sysroot=/path/to/sdk ``` it would only be used as a prefix to include paths and not as a prefix for `zig ld` linker.
Diffstat (limited to 'src')
-rw-r--r--src/clang_options_data.zig4
-rw-r--r--src/main.zig4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/clang_options_data.zig b/src/clang_options_data.zig
index 3c4c084976..85ff809761 100644
--- a/src/clang_options_data.zig
+++ b/src/clang_options_data.zig
@@ -1983,7 +1983,7 @@ flagpsl("MT"),
.{
.name = "sysroot",
.syntax = .separate,
- .zig_equivalent = .other,
+ .zig_equivalent = .sysroot,
.pd1 = false,
.pd2 = true,
.psl = false,
@@ -5970,7 +5970,7 @@ jspd1("undefined"),
.{
.name = "sysroot=",
.syntax = .joined,
- .zig_equivalent = .other,
+ .zig_equivalent = .sysroot,
.pd1 = false,
.pd2 = true,
.psl = false,
diff --git a/src/main.zig b/src/main.zig
index 4747772b8a..7756f48e26 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1476,6 +1476,9 @@ fn buildOutputType(
fatal("expected [command|reactor] for -mexec-mode=[value], found '{s}'", .{it.only_arg});
};
},
+ .sysroot => {
+ sysroot = it.only_arg;
+ },
}
}
// Parse linker args.
@@ -4130,6 +4133,7 @@ pub const ClangArgIterator = struct {
strip,
exec_model,
emit_llvm,
+ sysroot,
};
const Args = struct {