[gn build] Unbreak non-clang host builds
authorArthur Eubanks <aeubanks@google.com>
Wed, 25 Aug 2021 23:13:40 +0000 (16:13 -0700)
committerArthur Eubanks <aeubanks@google.com>
Wed, 25 Aug 2021 23:14:45 +0000 (16:14 -0700)
eecd5d0a broke non-clang host builds.
Some crt code is not always built with the just-built clang.

0da172b checked if the compiler is clang, not assert that the compiler
is clang.

llvm/utils/gn/build/BUILD.gn

index b0f02cf..31a5741 100644 (file)
@@ -407,12 +407,13 @@ config("crt_code") {
     "-gline-tables-only",
     "-fvisibility=hidden",
   ]
-  assert(is_clang, "CRT code is always built with just-built clang")
-  cflags += [
-    "-Werror=thread-safety",
-    "-Werror=thread-safety-reference",
-    "-Werror=thread-safety-beta",
-  ]
+  if (is_clang) {
+    cflags += [
+      "-Werror=thread-safety",
+      "-Werror=thread-safety-reference",
+      "-Werror=thread-safety-beta",
+    ]
+  }
 }
 
 config("warn_covered_switch_default") {