Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: build/config/fuchsia/BUILD.gn

Issue 2784063002: Config changes to support target_os="fuchsia" (Closed)
Patch Set: self review Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/config/fuchsia/BUILD.gn
diff --git a/build/config/fuchsia/BUILD.gn b/build/config/fuchsia/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..8ab7553bed30686bf1859c81e2be7693925e3bc6
--- /dev/null
+++ b/build/config/fuchsia/BUILD.gn
@@ -0,0 +1,71 @@
+# Copyright 2017 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/sysroot.gni")
+
+assert(is_fuchsia)
+assert(is_posix)
+
+config("werror") {
+ cflags = [
+ "-Werror",
+
+ # Declarations marked as deprecated should cause build failures, rather
+ # they should emit warnings to notify developers about the use of
+ # deprecated interfaces.
+ "-Wno-error=deprecated-declarations",
+
+ # Do not add additional -Wno-error to this config.
+ ]
+}
+
+config("icf") {
+ # This changes C/C++ semantics and might be incompatible with third-party
+ # code that relies on function pointers comparison.
+ ldflags = [ "-Wl,--icf=all" ]
+}
+
+config("compiler") {
+ cflags = []
+ cflags_c = [ "-std=c11" ]
+ cflags_cc = [ "-std=c++14" ]
+ ldflags = [ "-Wl,--threads" ]
+ configs = [
+ ":compiler_sysroot",
+ ":compiler_target",
+ ":icf",
+ ":werror",
+ ]
+ asmflags = cflags + cflags_c
+
+ libs = [
+ "mxio",
+ "magenta",
+ "unwind",
+ ]
+}
+
+config("compiler_sysroot") {
+ # The sole purpose of SYSROOT_VERSION is to change the command line on every
+ # sysroot update so as to force rebuilds.
+ defines = [ "SYSROOT_VERSION=$sysroot_version" ]
+ cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
+ ldflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
+ asmflags = cflags
+}
+
+config("compiler_target") {
+ cflags = []
+ ldflags = []
+ if (current_cpu == "arm64") {
+ cflags += [ "--target=aarch64-fuchsia" ]
+ ldflags += [ "--target=aarch64-fuchsia" ]
+ } else if (current_cpu == "x64") {
+ cflags += [ "--target=x86_64-fuchsia" ]
+ ldflags += [ "--target=x86_64-fuchsia" ]
+ } else {
+ assert(false, "Unsupported architecture")
+ }
+ asmflags = cflags
+}

Powered by Google App Engine
This is Rietveld 408576698