Chromium Code Reviews| 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..ec86c084da296b66cb04cc5f0d29da3a3207fa25 |
| --- /dev/null |
| +++ b/build/config/fuchsia/BUILD.gn |
| @@ -0,0 +1,50 @@ |
| +# Copyright 2017 The Chromium 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("compiler") { |
| + cflags = [] |
| + cflags_c = [ "-std=c11" ] |
| + cflags_cc = [ "-std=c++14" ] |
|
Nico
2017/05/11 17:43:37
Hm, I'd pretty strongly prefer if we could use the
scottmg
2017/05/11 17:52:53
OK, I was thinking it would match the OS headers,
|
| + ldflags = [ "-Wl,--threads" ] |
| + configs = [ |
| + ":compiler_sysroot", |
| + ":compiler_target", |
| + ] |
| + 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 |
| +} |