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 # Native Client Definitions | 5 # Native Client Definitions |
6 config("nacl_defines") { | 6 config("nacl_defines") { |
7 defines = [ | 7 defines = [ |
8 "NACL_ANDROID=0", | |
9 "_DEFAULT_SOURCE=1", | 8 "_DEFAULT_SOURCE=1", |
10 "_BSD_SOURCE=1", | 9 "_BSD_SOURCE=1", |
11 "_POSIX_C_SOURCE=199506", | 10 "_POSIX_C_SOURCE=199506", |
12 "_XOPEN_SOURCE=600", | 11 "_XOPEN_SOURCE=600", |
13 "_GNU_SOURCE=1", | 12 "_GNU_SOURCE=1", |
14 "__STDC_LIMIT_MACROS=1", | 13 "__STDC_LIMIT_MACROS=1", |
15 ] | 14 ] |
16 | |
17 if (is_win) { | |
18 defines += [ "NACL_WINDOWS=1" ] | |
19 } else { | |
20 defines += [ "NACL_WINDOWS=0" ] | |
21 } | |
22 | |
23 if (is_linux) { | |
24 defines += [ "NACL_LINUX=1" ] | |
25 } else { | |
26 defines += [ "NACL_LINUX=0" ] | |
27 } | |
28 | |
29 if (is_mac) { | |
30 defines += [ "NACL_OSX=1" ] | |
31 } else { | |
32 defines += [ "NACL_OSX=0" ] | |
33 } | |
34 | |
35 if (current_cpu == "arm") { | |
36 defines += [ | |
37 "NACL_BUILD_ARCH=arm", | |
38 "NACL_BUILD_SUBARCH=32", | |
39 ] | |
40 } | |
41 | |
42 if (current_cpu == "mips") { | |
43 defines += [ | |
44 "NACL_BUILD_ARCH=mips", | |
45 "NACL_BUILD_SUBARCH=32", | |
46 ] | |
47 } | |
48 | |
49 if (current_cpu == "x86") { | |
50 defines += [ | |
51 "NACL_BUILD_ARCH=x86", | |
52 "NACL_BUILD_SUBARCH=32", | |
53 ] | |
54 } | |
55 | |
56 if (current_cpu == "x64") { | |
57 defines += [ | |
58 "NACL_BUILD_ARCH=x86", | |
59 "NACL_BUILD_SUBARCH=64", | |
60 ] | |
61 } | |
62 } | 15 } |
63 | 16 |
64 config("nexe_defines") { | 17 config("nexe_defines") { |
65 defines = [ | 18 defines = [ |
66 "DYNAMIC_ANNOTATIONS_ENABLED=1", | 19 "DYNAMIC_ANNOTATIONS_ENABLED=1", |
67 "DYNAMIC_ANNOTATIONS_PREFIX=NACL_", | 20 "DYNAMIC_ANNOTATIONS_PREFIX=NACL_", |
68 ] | 21 ] |
69 } | 22 } |
70 | 23 |
71 # The base target that all targets in the NaCl build should depend on. | 24 # The base target that all targets in the NaCl build should depend on. |
72 # This allows configs to be modified for everything in the NaCl build, even when | 25 # This allows configs to be modified for everything in the NaCl build, even when |
73 # the NaCl build is composed into the Chrome build. (GN has no functionality to | 26 # the NaCl build is composed into the Chrome build. (GN has no functionality to |
74 # add flags to everythin in //native_client, having a base target works around | 27 # add flags to everythin in //native_client, having a base target works around |
75 # that limitation.) | 28 # that limitation.) |
76 source_set("nacl_base") { | 29 source_set("nacl_base") { |
77 public_configs = [ ":nacl_defines" ] | 30 public_configs = [ ":nacl_defines" ] |
78 if (current_os == "nacl") { | 31 if (current_os == "nacl") { |
79 public_configs += [ ":nexe_defines" ] | 32 public_configs += [ ":nexe_defines" ] |
80 } | 33 } |
81 } | 34 } |
OLD | NEW |