OLD | NEW |
1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/nacl/config.gni") | 5 import("//build/config/nacl/config.gni") |
6 | 6 |
7 # Native Client Definitions | 7 # Native Client Definitions |
8 config("nacl_defines") { | 8 config("nacl_defines") { |
9 if (is_linux || is_android || is_nacl) { | 9 if (is_linux || is_android || is_nacl) { |
10 defines = [ | 10 defines = [ |
11 "_POSIX_C_SOURCE=199506", | 11 "_POSIX_C_SOURCE=199506", |
12 "_XOPEN_SOURCE=600", | 12 "_XOPEN_SOURCE=600", |
13 "_GNU_SOURCE=1", | 13 "_GNU_SOURCE=1", |
14 "__STDC_LIMIT_MACROS=1", | 14 "__STDC_LIMIT_MACROS=1", |
15 ] | 15 ] |
16 } else if (is_win) { | 16 } else if (is_win) { |
17 defines = [ "__STDC_LIMIT_MACROS=1" ] | 17 defines = [ "__STDC_LIMIT_MACROS=1" ] |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
21 config("nexe_defines") { | 21 config("nexe_defines") { |
22 defines = [ | 22 defines = [ |
23 "DYNAMIC_ANNOTATIONS_ENABLED=1", | 23 "DYNAMIC_ANNOTATIONS_ENABLED=1", |
24 "DYNAMIC_ANNOTATIONS_PREFIX=NACL_", | 24 "DYNAMIC_ANNOTATIONS_PREFIX=NACL_", |
25 ] | 25 ] |
26 } | 26 } |
27 | 27 |
| 28 config("nacl_warnings") { |
| 29 if (is_win) { |
| 30 # Some NaCl code uses forward declarations of static const variables, |
| 31 # with initialized definitions later on. (The alternative would be |
| 32 # many, many more forward declarations of everything used in that |
| 33 # const variable's initializer before the definition.) The Windows |
| 34 # compiler is too stupid to notice that there is an initializer later |
| 35 # in the file, and warns about the forward declaration. |
| 36 cflags = [ "/wd4132" ] |
| 37 } |
| 38 } |
| 39 |
28 # The base target that all targets in the NaCl build should depend on. | 40 # The base target that all targets in the NaCl build should depend on. |
29 # This allows configs to be modified for everything in the NaCl build, even when | 41 # This allows configs to be modified for everything in the NaCl build, even when |
30 # the NaCl build is composed into the Chrome build. (GN has no functionality to | 42 # the NaCl build is composed into the Chrome build. (GN has no functionality to |
31 # add flags to everythin in //native_client, having a base target works around | 43 # add flags to everything in //native_client, having a base target works around |
32 # that limitation.) | 44 # that limitation.) |
33 source_set("nacl_base") { | 45 source_set("nacl_base") { |
34 public_configs = [ ":nacl_defines" ] | 46 public_configs = [ |
| 47 ":nacl_defines", |
| 48 ":nacl_warnings", |
| 49 ] |
35 if (current_os == "nacl") { | 50 if (current_os == "nacl") { |
36 public_configs += [ ":nexe_defines" ] | 51 public_configs += [ ":nexe_defines" ] |
37 } | 52 } |
38 } | 53 } |
39 | 54 |
40 config("compiler") { | 55 config("compiler") { |
41 configs = [] | 56 configs = [] |
42 cflags = [] | 57 cflags = [] |
43 ldflags = [] | 58 ldflags = [] |
44 libs = [] | 59 libs = [] |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 "-Os", | 128 "-Os", |
114 | 129 |
115 # These are omitted from non-IRT libraries to keep the libraries | 130 # These are omitted from non-IRT libraries to keep the libraries |
116 # themselves small. | 131 # themselves small. |
117 "-ffunction-sections", | 132 "-ffunction-sections", |
118 "-fdata-sections", | 133 "-fdata-sections", |
119 ] | 134 ] |
120 | 135 |
121 ldflags = [ "-Wl,--gc-sections" ] | 136 ldflags = [ "-Wl,--gc-sections" ] |
122 } | 137 } |
OLD | NEW |