Skip to content

Commit d69bc40

Browse files
authored
swift_autoconfiguration: handle case where CC isn't set (#696)
1 parent c85676d commit d69bc40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

swift/internal/swift_autoconfiguration.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ def _create_linux_toolchain(repository_ctx):
207207
Args:
208208
repository_ctx: The repository rule context.
209209
"""
210-
if "clang" not in repository_ctx.os.environ.get("CC"):
210+
cc = repository_ctx.os.environ.get("CC") or ""
211+
if "clang" not in cc:
211212
fail("ERROR: rules_swift uses Bazel's CROSSTOOL to link, but Swift " +
212213
"requires that the driver used is clang. Please set `CC=clang` " +
213214
"in your environment before invoking Bazel.")

0 commit comments

Comments
 (0)