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 # ============================================================================= | 5 # ============================================================================= |
6 # BUILD FLAGS | 6 # BUILD FLAGS |
7 # ============================================================================= | 7 # ============================================================================= |
8 # | 8 # |
9 # This block lists input arguments to the build, along with their default | 9 # This block lists input arguments to the build, along with their default |
10 # values. GN requires listing them explicitly so it can validate input and have | 10 # values. GN requires listing them explicitly so it can validate input and have |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 # Compile for Leak Sanitizer to find leaks. | 76 # Compile for Leak Sanitizer to find leaks. |
77 is_lsan = false | 77 is_lsan = false |
78 | 78 |
79 # Compile for Memory Sanitizer to find uninitialized reads. | 79 # Compile for Memory Sanitizer to find uninitialized reads. |
80 is_msan = false | 80 is_msan = false |
81 | 81 |
82 # Compile for Thread Sanitizer to find threading bugs. | 82 # Compile for Thread Sanitizer to find threading bugs. |
83 is_tsan = false | 83 is_tsan = false |
84 | 84 |
85 if (current_os == "chromeos") { | 85 # Used for compiling chromeos interface on linux OSes. |
86 # Allows the target toolchain to be injected as arguments. This is needed | 86 is_chromeos_ui = current_os == "chromeos" |
87 # to support the CrOS build system which supports per-build-configuration | 87 |
88 # toolchains. | 88 # This controls some aspects fo being a traditional desktop linux |
89 cros_use_custom_toolchain = false | 89 is_desktop_linux = current_os == "linux" && !is_chromeos_ui |
90 } | 90 |
| 91 # Allows the target toolchain to be injected as arguments. This is needed |
| 92 # to support the CrOS build system which supports per-build-configuration |
| 93 # toolchains. |
| 94 cros_use_custom_toolchain = false |
91 } | 95 } |
92 | 96 |
93 # ============================================================================= | 97 # ============================================================================= |
94 # OS DEFINITIONS | 98 # OS DEFINITIONS |
95 # ============================================================================= | 99 # ============================================================================= |
96 # | 100 # |
97 # We set these various is_FOO booleans for convenience in writing OS-based | 101 # We set these various is_FOO booleans for convenience in writing OS-based |
98 # conditions. | 102 # conditions. |
99 # | 103 # |
100 # - is_android, is_chromeos, is_ios, and is_win should be obvious. | 104 # - is_android, is_ios, and is_win should be obvious. |
101 # - is_mac is set only for desktop Mac. It is not set on iOS. | 105 # - is_mac is set only for desktop Mac. It is not set on iOS. |
102 # - is_posix is true for mac and any Unix-like system (basically everything | 106 # - is_posix is true for mac and any Unix-like system (basically everything |
103 # except Windows). | 107 # except Windows). |
104 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is | 108 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is |
105 # generally too different despite being based on the Linux kernel). | 109 # generally too different despite being based on the Linux kernel). |
| 110 # - is_chromeos_os is true when compiling for a destination chromeos device. |
| 111 # - is_chromeos_ui is true when compiling for either a chromeos device or |
| 112 # debugging on desktop for the same. |
106 # | 113 # |
107 # Do not add more is_* variants here for random lesser-used Unix systems like | 114 # Do not add more is_* variants here for random lesser-used Unix systems like |
108 # aix or one of the BSDs. If you need to check these, just check the os value | 115 # aix or one of the BSDs. If you need to check these, just check the os value |
109 # directly. | 116 # directly. |
110 | 117 |
111 if (current_os == "win") { | 118 if (current_os == "win") { |
112 is_android = false | 119 is_android = false |
113 is_chromeos = false | 120 is_chromeos_os = false |
114 is_ios = false | 121 is_ios = false |
115 is_linux = false | 122 is_linux = false |
116 is_mac = false | 123 is_mac = false |
117 is_nacl = false | 124 is_nacl = false |
118 is_posix = false | 125 is_posix = false |
119 is_win = true | 126 is_win = true |
120 } else if (current_os == "mac") { | 127 } else if (current_os == "mac") { |
121 is_android = false | 128 is_android = false |
122 is_chromeos = false | 129 is_chromeos_os = false |
123 is_ios = false | 130 is_ios = false |
124 is_linux = false | 131 is_linux = false |
125 is_mac = true | 132 is_mac = true |
126 is_nacl = false | 133 is_nacl = false |
127 is_posix = true | 134 is_posix = true |
128 is_win = false | 135 is_win = false |
129 } else if (current_os == "android") { | 136 } else if (current_os == "android") { |
130 is_android = true | 137 is_android = true |
131 is_chromeos = false | 138 is_chromeos_os = false |
132 is_ios = false | 139 is_ios = false |
133 is_linux = false | 140 is_linux = false |
134 is_mac = false | 141 is_mac = false |
135 is_nacl = false | 142 is_nacl = false |
136 is_posix = true | 143 is_posix = true |
137 is_win = false | 144 is_win = false |
138 } else if (current_os == "chromeos") { | 145 } else if (current_os == "chromeos") { |
139 is_android = false | 146 is_android = false |
140 is_chromeos = true | 147 is_chromeos_ui = true |
| 148 is_chromeos_os = true |
141 is_ios = false | 149 is_ios = false |
142 is_linux = true | 150 is_linux = true |
143 is_mac = false | 151 is_mac = false |
144 is_nacl = false | 152 is_nacl = false |
145 is_posix = true | 153 is_posix = true |
146 is_win = false | 154 is_win = false |
147 } else if (current_os == "nacl") { | 155 } else if (current_os == "nacl") { |
148 # current_os == "nacl" will be passed by the nacl toolchain definition. It is
not | 156 # current_os == "nacl" will be passed by the nacl toolchain definition. It is
not |
149 # set by default or on the command line. We treat is as a Posix variant. | 157 # set by default or on the command line. We treat is as a Posix variant. |
150 is_android = false | 158 is_android = false |
151 is_chromeos = false | 159 is_chromeos_os = false |
152 is_ios = false | 160 is_ios = false |
153 is_linux = false | 161 is_linux = false |
154 is_mac = false | 162 is_mac = false |
155 is_nacl = true | 163 is_nacl = true |
156 is_posix = true | 164 is_posix = true |
157 is_win = false | 165 is_win = false |
158 } else if (current_os == "ios") { | 166 } else if (current_os == "ios") { |
159 is_android = false | 167 is_android = false |
160 is_chromeos = false | 168 is_chromeos_os = false |
161 is_ios = true | 169 is_ios = true |
162 is_linux = false | 170 is_linux = false |
163 is_mac = false | 171 is_mac = false |
164 is_nacl = false | 172 is_nacl = false |
165 is_posix = true | 173 is_posix = true |
166 is_win = false | 174 is_win = false |
167 } else if (current_os == "linux") { | 175 } else if (current_os == "linux") { |
168 is_android = false | 176 is_android = false |
169 is_chromeos = false | 177 is_chromeos_os = false |
170 is_ios = false | 178 is_ios = false |
171 is_linux = true | 179 is_linux = true |
172 is_mac = false | 180 is_mac = false |
173 is_nacl = false | 181 is_nacl = false |
174 is_posix = true | 182 is_posix = true |
175 is_win = false | 183 is_win = false |
176 } | 184 } |
177 | 185 |
178 is_desktop_linux = is_linux && !is_chromeos | |
179 | 186 |
180 # ============================================================================= | 187 # ============================================================================= |
181 # CPU ARCHITECTURE | 188 # CPU ARCHITECTURE |
182 # ============================================================================= | 189 # ============================================================================= |
183 | 190 |
184 if (is_win) { | 191 if (is_win) { |
185 # Always use 32-bit on Windows, even when compiling on a 64-bit host OS, | 192 # Always use 32-bit on Windows, even when compiling on a 64-bit host OS, |
186 # unless the override flag is specified. | 193 # unless the override flag is specified. |
187 if (force_win64) { | 194 if (force_win64) { |
188 current_cpu = "x64" | 195 current_cpu = "x64" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 276 } |
270 if (!is_android) { | 277 if (!is_android) { |
271 sources_assignment_filter += [ | 278 sources_assignment_filter += [ |
272 "*_android.h", | 279 "*_android.h", |
273 "*_android.cc", | 280 "*_android.cc", |
274 "*_android_unittest.h", | 281 "*_android_unittest.h", |
275 "*_android_unittest.cc", | 282 "*_android_unittest.cc", |
276 "*\bandroid/*", | 283 "*\bandroid/*", |
277 ] | 284 ] |
278 } | 285 } |
279 if (!is_chromeos) { | 286 if (!is_chromeos_ui) { |
280 sources_assignment_filter += [ | 287 sources_assignment_filter += [ |
281 "*_chromeos.h", | 288 "*_chromeos.h", |
282 "*_chromeos.cc", | 289 "*_chromeos.cc", |
283 "*_chromeos_unittest.h", | 290 "*_chromeos_unittest.h", |
284 "*_chromeos_unittest.cc", | 291 "*_chromeos_unittest.cc", |
285 "*\bchromeos/*", | 292 "*\bchromeos/*", |
286 ] | 293 ] |
287 } | 294 } |
288 | 295 |
289 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call | 296 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 } | 873 } |
867 if (defined(invoker.sources)) { | 874 if (defined(invoker.sources)) { |
868 sources = invoker.sources | 875 sources = invoker.sources |
869 } | 876 } |
870 if (defined(invoker.visibility)) { | 877 if (defined(invoker.visibility)) { |
871 visibility = invoker.visibility | 878 visibility = invoker.visibility |
872 } | 879 } |
873 } | 880 } |
874 } | 881 } |
875 } | 882 } |
OLD | NEW |