Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium 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 # PLATFORM SELECTION | 6 # PLATFORM SELECTION |
| 7 # ============================================================================= | 7 # ============================================================================= |
| 8 # | 8 # |
| 9 # There are two main things to set: "os" and "cpu". The "toolchain" is the name | 9 # There are two main things to set: "os" and "cpu". The "toolchain" is the name |
| 10 # of the GN thing that encodes combinations of these things. | 10 # of the GN thing that encodes combinations of these things. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 # 0 means no symbols. | 118 # 0 means no symbols. |
| 119 # -1 means auto-set (off in release, regular in debug). | 119 # -1 means auto-set (off in release, regular in debug). |
| 120 symbol_level = -1 | 120 symbol_level = -1 |
| 121 | 121 |
| 122 # Component build. | 122 # Component build. |
| 123 is_component_build = false | 123 is_component_build = false |
| 124 | 124 |
| 125 # Debug build. | 125 # Debug build. |
| 126 is_debug = true | 126 is_debug = true |
| 127 | 127 |
| 128 # Whether we're building components and interfaces for ChromeOS | |
| 129 # This is for backwards compatability until the rename in complete in all | |
| 130 # dependent files. See use_cros_ui in ui.gni. They should be the same. | |
| 131 # TODO(petermayo): Remove this when it doesn't break known compiles. | |
| 132 is_chromeos = current_os == "chromeos" | |
| 133 | |
| 128 # Whether we're a traditional desktop unix. | 134 # Whether we're a traditional desktop unix. |
| 129 is_desktop_linux = current_os == "linux" && current_os != "chromeos" | 135 is_desktop_linux = current_os == "linux" && !is_chromeos |
| 130 | 136 |
| 131 # Set to true when compiling with the Clang compiler. Typically this is used | 137 # Set to true when compiling with the Clang compiler. Typically this is used |
| 132 # to configure warnings. | 138 # to configure warnings. |
| 133 is_clang = current_os == "mac" || current_os == "ios" || | 139 is_clang = current_os == "mac" || current_os == "ios" || |
| 134 current_os == "linux" || current_os == "chromeos" | 140 current_os == "linux" || current_os == "chromeos" |
| 135 | 141 |
| 136 # Compile for Address Sanitizer to find memory bugs. | 142 # Compile for Address Sanitizer to find memory bugs. |
| 137 is_asan = false | 143 is_asan = false |
| 138 | 144 |
| 139 # Compile for Leak Sanitizer to find leaks. | 145 # Compile for Leak Sanitizer to find leaks. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 155 # DON'T ADD MORE FLAGS HERE. Read the comment above. | 161 # DON'T ADD MORE FLAGS HERE. Read the comment above. |
| 156 } | 162 } |
| 157 | 163 |
| 158 # ============================================================================= | 164 # ============================================================================= |
| 159 # OS DEFINITIONS | 165 # OS DEFINITIONS |
| 160 # ============================================================================= | 166 # ============================================================================= |
| 161 # | 167 # |
| 162 # We set these various is_FOO booleans for convenience in writing OS-based | 168 # We set these various is_FOO booleans for convenience in writing OS-based |
| 163 # conditions. | 169 # conditions. |
| 164 # | 170 # |
| 165 # - is_android, is_chromeos, is_ios, and is_win should be obvious. | 171 # - is_android, is_ios, and is_win should be obvious. |
| 166 # - is_mac is set only for desktop Mac. It is not set on iOS. | 172 # - is_mac is set only for desktop Mac. It is not set on iOS. |
| 167 # - is_posix is true for mac and any Unix-like system (basically everything | 173 # - is_posix is true for mac and any Unix-like system (basically everything |
| 168 # except Windows). | 174 # except Windows). |
| 169 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is | 175 # - is_linux is true for desktop Linux and ChromeOS, but not Android (which is |
| 170 # generally too different despite being based on the Linux kernel). | 176 # generally too different despite being based on the Linux kernel). |
| 177 # - is_chromeos_os is true if the results are expected to run on a ChromeOS | |
| 178 # machine, using the filesystem and runtime libraries specifed by | |
| 179 # a build of that OS, rather than local linux. E.g. presume an update | |
| 180 # system, journalled files system, storage modes, no other apps, etc. | |
| 171 # | 181 # |
| 172 # Do not add more is_* variants here for random lesser-used Unix systems like | 182 # Do not add more is_* variants here for random lesser-used Unix systems like |
| 173 # aix or one of the BSDs. If you need to check these, just check the | 183 # aix or one of the BSDs. If you need to check these, just check the |
| 174 # current_os value directly. | 184 # current_os value directly. |
| 175 | 185 |
| 176 if (current_os == "win" || current_os == "winrt_81" || | 186 if (current_os == "win" || current_os == "winrt_81" || |
| 177 current_os == "winrt_81_phone" || current_os == "winrt_10") { | 187 current_os == "winrt_81_phone" || current_os == "winrt_10") { |
| 178 is_android = false | 188 is_android = false |
| 179 is_chromeos = false | 189 is_chromeos_os = false |
| 180 is_ios = false | 190 is_ios = false |
| 181 is_linux = false | 191 is_linux = false |
| 182 is_mac = false | 192 is_mac = false |
| 183 is_nacl = false | 193 is_nacl = false |
| 184 is_posix = false | 194 is_posix = false |
| 185 is_win = true | 195 is_win = true |
| 186 } else if (current_os == "mac") { | 196 } else if (current_os == "mac") { |
| 187 is_android = false | 197 is_android = false |
| 188 is_chromeos = false | 198 is_chromeos_os = false |
| 189 is_ios = false | 199 is_ios = false |
| 190 is_linux = false | 200 is_linux = false |
| 191 is_mac = true | 201 is_mac = true |
| 192 is_nacl = false | 202 is_nacl = false |
| 193 is_posix = true | 203 is_posix = true |
| 194 is_win = false | 204 is_win = false |
| 195 } else if (current_os == "android") { | 205 } else if (current_os == "android") { |
| 196 is_android = true | 206 is_android = true |
| 197 is_chromeos = false | 207 is_chromeos_os = false |
| 198 is_ios = false | 208 is_ios = false |
| 199 is_linux = false | 209 is_linux = false |
| 200 is_mac = false | 210 is_mac = false |
| 201 is_nacl = false | 211 is_nacl = false |
| 202 is_posix = true | 212 is_posix = true |
| 203 is_win = false | 213 is_win = false |
| 204 } else if (current_os == "chromeos") { | 214 } else if (current_os == "chromeos") { |
| 205 is_android = false | 215 is_android = false |
| 206 is_chromeos = true | 216 assert(is_chromeos, "ChromiumOS requires is_chromeos.") |
| 217 is_chromeos_os = true | |
| 207 is_ios = false | 218 is_ios = false |
| 208 is_linux = true | 219 is_linux = true |
| 209 is_mac = false | 220 is_mac = false |
| 210 is_nacl = false | 221 is_nacl = false |
| 211 is_posix = true | 222 is_posix = true |
| 212 is_win = false | 223 is_win = false |
| 213 } else if (current_os == "nacl") { | 224 } else if (current_os == "nacl") { |
| 214 # current_os == "nacl" will be passed by the nacl toolchain definition. | 225 # current_os == "nacl" will be passed by the nacl toolchain definition. |
| 215 # It is not set by default or on the command line. We treat is as a | 226 # It is not set by default or on the command line. We treat is as a |
| 216 # Posix variant. | 227 # Posix variant. |
| 217 is_android = false | 228 is_android = false |
| 218 is_chromeos = false | 229 is_chromeos_os = false |
| 219 is_ios = false | 230 is_ios = false |
| 220 is_linux = false | 231 is_linux = false |
| 221 is_mac = false | 232 is_mac = false |
| 222 is_nacl = true | 233 is_nacl = true |
| 223 is_posix = true | 234 is_posix = true |
| 224 is_win = false | 235 is_win = false |
| 225 } else if (current_os == "ios") { | 236 } else if (current_os == "ios") { |
| 226 is_android = false | 237 is_android = false |
| 227 is_chromeos = false | 238 is_chromeos_os = false |
| 228 is_ios = true | 239 is_ios = true |
| 229 is_linux = false | 240 is_linux = false |
| 230 is_mac = false | 241 is_mac = false |
| 231 is_nacl = false | 242 is_nacl = false |
| 232 is_posix = true | 243 is_posix = true |
| 233 is_win = false | 244 is_win = false |
| 234 } else if (current_os == "linux") { | 245 } else if (current_os == "linux") { |
| 235 is_android = false | 246 is_android = false |
| 236 is_chromeos = false | 247 is_chromeos_os = false |
| 237 is_ios = false | 248 is_ios = false |
| 238 is_linux = true | 249 is_linux = true |
| 239 is_mac = false | 250 is_mac = false |
| 240 is_nacl = false | 251 is_nacl = false |
| 241 is_posix = true | 252 is_posix = true |
| 242 is_win = false | 253 is_win = false |
| 243 } | 254 } |
| 244 | 255 |
| 245 # ============================================================================= | 256 # ============================================================================= |
| 246 # SOURCES FILTERS | 257 # SOURCES FILTERS |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 } | 332 } |
| 322 if (!is_android) { | 333 if (!is_android) { |
| 323 sources_assignment_filter += [ | 334 sources_assignment_filter += [ |
| 324 "*_android.h", | 335 "*_android.h", |
| 325 "*_android.cc", | 336 "*_android.cc", |
| 326 "*_android_unittest.h", | 337 "*_android_unittest.h", |
| 327 "*_android_unittest.cc", | 338 "*_android_unittest.cc", |
| 328 "*\bandroid/*", | 339 "*\bandroid/*", |
| 329 ] | 340 ] |
| 330 } | 341 } |
| 342 | |
| 343 #TODO(petermayo): Move this to ui.gni with the removal of is_chromeos | |
|
Peter Mayo
2015/08/19 21:42:05
This affects a lot of places. North of 400 direct
| |
| 331 if (!is_chromeos) { | 344 if (!is_chromeos) { |
| 332 sources_assignment_filter += [ | 345 sources_assignment_filter += [ |
| 333 "*_chromeos.h", | 346 "*_chromeos.h", |
| 334 "*_chromeos.cc", | 347 "*_chromeos.cc", |
| 335 "*_chromeos_unittest.h", | 348 "*_chromeos_unittest.h", |
| 336 "*_chromeos_unittest.cc", | 349 "*_chromeos_unittest.cc", |
| 337 "*\bchromeos/*", | 350 "*\bchromeos/*", |
| 338 ] | 351 ] |
| 339 } | 352 } |
| 340 | 353 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 618 forward_variables_from(invoker, "*") | 631 forward_variables_from(invoker, "*") |
| 619 | 632 |
| 620 # All shared libraries must have the sanitizer deps to properly link in | 633 # All shared libraries must have the sanitizer deps to properly link in |
| 621 # asan mode (this target will be empty in other cases). | 634 # asan mode (this target will be empty in other cases). |
| 622 if (!defined(deps)) { | 635 if (!defined(deps)) { |
| 623 deps = [] | 636 deps = [] |
| 624 } | 637 } |
| 625 deps += [ "//build/config/sanitizers:deps" ] | 638 deps += [ "//build/config/sanitizers:deps" ] |
| 626 } | 639 } |
| 627 } | 640 } |
| OLD | NEW |