blob: e05207403927944dd7ba375c10f34280cf7b95a3 [file] [log] [blame]
diff --git a/build/config/clang/clang.gni b/build/config/clang/clang.gni
index 7196fcf6c1..423ffbdd09 100644
--- a/build/config/clang/clang.gni
+++ b/build/config/clang/clang.gni
@@ -15,4 +15,7 @@ declare_args() {
default_toolchain != "//build/toolchain/cros:target"
clang_base_path = default_clang_base_path
+
+ # Specifies whether or not bitcode should be embedded in all compiled targets
+ clang_embed_bitcode = false
}
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index d3adf9735c..6bad05bf7e 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -838,6 +838,10 @@ config("compiler") {
}
}
+ if (is_clang && clang_embed_bitcode) {
+ cflags += [ "-Xclang", "-fembed-bitcode=all" ]
+ }
+
# Pass the same C/C++ flags to the objective C/C++ compiler.
cflags_objc += cflags_c
cflags_objcc += cflags_cc