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

Side by Side Diff: build/config/fuchsia/BUILD.gn

Issue 2692273008: Hacky slashy (Closed)
Patch Set: tidy up required gn flags, use sdk Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2017 The Fuchsia Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/sysroot.gni")
6
7 assert(is_fuchsia)
8 assert(is_posix)
9
10 config("werror") {
11 cflags = [
12 "-Werror",
13
14 # Declarations marked as deprecated should cause build failures, rather
15 # they should emit warnings to notify developers about the use of
16 # deprecated interfaces.
17 "-Wno-error=deprecated-declarations",
18
19 # Do not add additional -Wno-error to this config.
20 ]
21 }
22
23 config("icf") {
24 # This changes C/C++ semantics and might be incompatible with third-party
25 # code that relies on function pointers comparison.
26 ldflags = [ "-Wl,--icf=all" ]
27 }
28
29 config("compiler") {
30 cflags = []
31 cflags_c = [ "-std=c11" ]
32 cflags_cc = [ "-std=c++14" ]
33 ldflags = [
34 "-Wl,--threads",
35 "-lmxio",
jamesr 2017/02/18 00:18:40 could these just go in 'libs' ?
scottmg 2017/02/18 00:25:19 Done.
36 "-lmagenta",
37 "-lunwind",
38 ]
39 configs = [
40 ":compiler_sysroot",
41 ":compiler_target",
42 ":icf",
43 ":werror",
44 ]
45 asmflags = cflags + cflags_c
46 }
47
48 config("compiler_sysroot") {
49 # The sole purpose of SYSROOT_VERSION is to change the command line on every
50 # sysroot update so as to force rebuilds.
51 defines = [ "SYSROOT_VERSION=$sysroot_version" ]
52 cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
53 ldflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ]
54 asmflags = cflags
55 }
56
57 config("compiler_target") {
58 cflags = []
59 ldflags = []
60 if (current_cpu == "arm64") {
61 cflags += [ "--target=aarch64-fuchsia" ]
62 ldflags += [ "--target=aarch64-fuchsia" ]
63 } else if (current_cpu == "x64") {
64 cflags += [ "--target=x86_64-fuchsia" ]
65 ldflags += [ "--target=x86_64-fuchsia" ]
66 } else {
67 assert(false, "Unsupported architecture")
68 }
69 asmflags = cflags
70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698