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 # WHAT IS THIS FILE? | 6 # WHAT IS THIS FILE? |
| 7 # ============================================================================= | 7 # ============================================================================= |
| 8 # | 8 # |
| 9 # This is the master GN build configuration. This file is loaded after the | 9 # This is the master GN build configuration. This file is loaded after the |
| 10 # build args (args.gn) for the build directory and after the toplevel ".gn" | 10 # build args (args.gn) for the build directory and after the toplevel ".gn" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 # separate flags. | 130 # separate flags. |
| 131 is_official_build = false | 131 is_official_build = false |
| 132 | 132 |
| 133 # Whether we're a traditional desktop unix. | 133 # Whether we're a traditional desktop unix. |
| 134 is_desktop_linux = current_os == "linux" | 134 is_desktop_linux = current_os == "linux" |
| 135 | 135 |
| 136 # Set to true when compiling with the Clang compiler. Typically this is used | 136 # Set to true when compiling with the Clang compiler. Typically this is used |
| 137 # to configure warnings. | 137 # to configure warnings. |
| 138 is_clang = | 138 is_clang = |
| 139 current_os == "mac" || current_os == "ios" || current_os == "chromeos" || | 139 current_os == "mac" || current_os == "ios" || current_os == "chromeos" || |
| 140 current_os == "fuchsia" || | |
| 140 (current_os == "linux" && current_cpu != "s390x" && | 141 (current_os == "linux" && current_cpu != "s390x" && |
| 141 current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc") | 142 current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc") |
| 142 | 143 |
| 143 # Allows the path to a custom target toolchain to be injected as a single | 144 # Allows the path to a custom target toolchain to be injected as a single |
| 144 # argument, and set as the default toolchain. | 145 # argument, and set as the default toolchain. |
| 145 custom_toolchain = "" | 146 custom_toolchain = "" |
| 146 | 147 |
| 147 # This should not normally be set as a build argument. It's here so that | 148 # This should not normally be set as a build argument. It's here so that |
| 148 # every toolchain can pass through the "global" value via toolchain_args(). | 149 # every toolchain can pass through the "global" value via toolchain_args(). |
| 149 host_toolchain = "" | 150 host_toolchain = "" |
| 150 | 151 |
| 151 # DON'T ADD MORE FLAGS HERE. Read the comment above. | 152 # DON'T ADD MORE FLAGS HERE. Read the comment above. |
| 152 } | 153 } |
| 153 | 154 |
| 154 declare_args() { | 155 declare_args() { |
| 155 # Debug build. Enabling official builds automatically sets is_debug to false. | 156 # Debug build. Enabling official builds automatically sets is_debug to false. |
| 156 is_debug = !is_official_build | 157 is_debug = !is_official_build |
| 157 } | 158 } |
| 158 | 159 |
| 159 declare_args() { | 160 declare_args() { |
| 160 # Component build. Setting to true compiles targets declared as "components" | 161 # Component build. Setting to true compiles targets declared as "components" |
| 161 # as shared libraries loaded dynamically. This speeds up development time. | 162 # as shared libraries loaded dynamically. This speeds up development time. |
| 162 # When false, components will be linked statically. | 163 # When false, components will be linked statically. |
| 163 # | 164 # |
| 164 # For more information see | 165 # For more information see |
| 165 # https://chromium.googlesource.com/chromium/src/+/master/docs/component_build .md | 166 # https://chromium.googlesource.com/chromium/src/+/master/docs/component_build .md |
| 166 is_component_build = is_debug && current_os != "ios" | 167 is_component_build = |
| 168 is_debug && current_os != "ios" && current_os != "fuchsia" | |
| 167 } | 169 } |
| 168 | 170 |
| 169 assert(!(is_debug && is_official_build), "Can't do official debug builds") | 171 assert(!(is_debug && is_official_build), "Can't do official debug builds") |
| 170 | 172 |
| 171 # ============================================================================== | 173 # ============================================================================== |
| 172 # TOOLCHAIN SETUP | 174 # TOOLCHAIN SETUP |
| 173 # ============================================================================== | 175 # ============================================================================== |
| 174 # | 176 # |
| 175 # Here we set the default toolchain, as well as the variable host_toolchain | 177 # Here we set the default toolchain, as well as the variable host_toolchain |
| 176 # which will identify the toolchain corresponding to the local system when | 178 # which will identify the toolchain corresponding to the local system when |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 } else { | 228 } else { |
| 227 _default_toolchain = "//build/toolchain/android:android_$target_cpu" | 229 _default_toolchain = "//build/toolchain/android:android_$target_cpu" |
| 228 } | 230 } |
| 229 } else if (target_os == "chromeos" || target_os == "linux") { | 231 } else if (target_os == "chromeos" || target_os == "linux") { |
| 230 # See comments in build/toolchain/cros/BUILD.gn about board compiles. | 232 # See comments in build/toolchain/cros/BUILD.gn about board compiles. |
| 231 if (is_clang) { | 233 if (is_clang) { |
| 232 _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" | 234 _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" |
| 233 } else { | 235 } else { |
| 234 _default_toolchain = "//build/toolchain/linux:$target_cpu" | 236 _default_toolchain = "//build/toolchain/linux:$target_cpu" |
| 235 } | 237 } |
| 238 } else if (target_os == "fuchsia") { | |
| 239 _default_toolchain = "//build/toolchain/fuchsia:$target_cpu" | |
| 236 } else if (target_os == "ios") { | 240 } else if (target_os == "ios") { |
| 237 _default_toolchain = "//build/toolchain/mac:ios_clang_$target_cpu" | 241 _default_toolchain = "//build/toolchain/mac:ios_clang_$target_cpu" |
| 238 } else if (target_os == "mac") { | 242 } else if (target_os == "mac") { |
| 239 assert(host_os == "mac", "Mac cross-compiles are unsupported.") | 243 assert(host_os == "mac", "Mac cross-compiles are unsupported.") |
| 240 _default_toolchain = host_toolchain | 244 _default_toolchain = host_toolchain |
| 241 } else if (target_os == "win") { | 245 } else if (target_os == "win") { |
| 242 # On Windows we use the same toolchain for host and target by default. | 246 # On Windows we use the same toolchain for host and target by default. |
| 243 assert(target_os == host_os, "Win cross-compiles only work on win hosts.") | 247 assert(target_os == host_os, "Win cross-compiles only work on win hosts.") |
| 244 if (is_clang) { | 248 if (is_clang) { |
| 245 _default_toolchain = "//build/toolchain/win:clang_$target_cpu" | 249 _default_toolchain = "//build/toolchain/win:clang_$target_cpu" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 # generally too different despite being based on the Linux kernel). | 282 # generally too different despite being based on the Linux kernel). |
| 279 # | 283 # |
| 280 # Do not add more is_* variants here for random lesser-used Unix systems like | 284 # Do not add more is_* variants here for random lesser-used Unix systems like |
| 281 # aix or one of the BSDs. If you need to check these, just check the | 285 # aix or one of the BSDs. If you need to check these, just check the |
| 282 # current_os value directly. | 286 # current_os value directly. |
| 283 | 287 |
| 284 if (current_os == "win" || current_os == "winrt_81" || | 288 if (current_os == "win" || current_os == "winrt_81" || |
| 285 current_os == "winrt_81_phone" || current_os == "winrt_10") { | 289 current_os == "winrt_81_phone" || current_os == "winrt_10") { |
| 286 is_android = false | 290 is_android = false |
| 287 is_chromeos = false | 291 is_chromeos = false |
| 292 is_fuchsia = false | |
| 288 is_ios = false | 293 is_ios = false |
| 289 is_linux = false | 294 is_linux = false |
| 290 is_mac = false | 295 is_mac = false |
| 291 is_nacl = false | 296 is_nacl = false |
| 292 is_posix = false | 297 is_posix = false |
| 293 is_win = true | 298 is_win = true |
| 294 } else if (current_os == "mac") { | 299 } else if (current_os == "mac") { |
| 295 is_android = false | 300 is_android = false |
| 296 is_chromeos = false | 301 is_chromeos = false |
| 302 is_fuchsia = false | |
| 297 is_ios = false | 303 is_ios = false |
| 298 is_linux = false | 304 is_linux = false |
| 299 is_mac = true | 305 is_mac = true |
| 300 is_nacl = false | 306 is_nacl = false |
| 301 is_posix = true | 307 is_posix = true |
| 302 is_win = false | 308 is_win = false |
| 303 } else if (current_os == "android") { | 309 } else if (current_os == "android") { |
| 304 is_android = true | 310 is_android = true |
| 305 is_chromeos = false | 311 is_chromeos = false |
| 312 is_fuchsia = false | |
| 306 is_ios = false | 313 is_ios = false |
| 307 is_linux = false | 314 is_linux = false |
| 308 is_mac = false | 315 is_mac = false |
| 309 is_nacl = false | 316 is_nacl = false |
| 310 is_posix = true | 317 is_posix = true |
| 311 is_win = false | 318 is_win = false |
| 312 } else if (current_os == "chromeos") { | 319 } else if (current_os == "chromeos") { |
| 313 is_android = false | 320 is_android = false |
| 314 is_chromeos = true | 321 is_chromeos = true |
| 322 is_fuchsia = false | |
| 315 is_ios = false | 323 is_ios = false |
| 316 is_linux = true | 324 is_linux = true |
| 317 is_mac = false | 325 is_mac = false |
| 318 is_nacl = false | 326 is_nacl = false |
| 319 is_posix = true | 327 is_posix = true |
| 320 is_win = false | 328 is_win = false |
| 321 } else if (current_os == "nacl") { | 329 } else if (current_os == "nacl") { |
| 322 # current_os == "nacl" will be passed by the nacl toolchain definition. | 330 # current_os == "nacl" will be passed by the nacl toolchain definition. |
| 323 # It is not set by default or on the command line. We treat is as a | 331 # It is not set by default or on the command line. We treat is as a |
| 324 # Posix variant. | 332 # Posix variant. |
| 325 is_android = false | 333 is_android = false |
| 326 is_chromeos = false | 334 is_chromeos = false |
| 335 is_fuchsia = false | |
| 327 is_ios = false | 336 is_ios = false |
| 328 is_linux = false | 337 is_linux = false |
| 329 is_mac = false | 338 is_mac = false |
| 330 is_nacl = true | 339 is_nacl = true |
| 331 is_posix = true | 340 is_posix = true |
| 332 is_win = false | 341 is_win = false |
| 342 } else if (current_os == "fuchsia") { | |
| 343 is_android = false | |
| 344 is_chromeos = false | |
| 345 is_fuchsia = true | |
| 346 is_ios = false | |
| 347 is_linux = false | |
| 348 is_mac = false | |
| 349 is_nacl = false | |
| 350 is_posix = true | |
| 351 is_win = false | |
| 333 } else if (current_os == "ios") { | 352 } else if (current_os == "ios") { |
| 334 is_android = false | 353 is_android = false |
| 335 is_chromeos = false | 354 is_chromeos = false |
| 355 is_fuchsia = false | |
| 336 is_ios = true | 356 is_ios = true |
| 337 is_linux = false | 357 is_linux = false |
| 338 is_mac = false | 358 is_mac = false |
| 339 is_nacl = false | 359 is_nacl = false |
| 340 is_posix = true | 360 is_posix = true |
| 341 is_win = false | 361 is_win = false |
| 342 } else if (current_os == "linux") { | 362 } else if (current_os == "linux") { |
| 343 is_android = false | 363 is_android = false |
| 344 is_chromeos = false | 364 is_chromeos = false |
| 365 is_fuchsia = false | |
| 345 is_ios = false | 366 is_ios = false |
| 346 is_linux = true | 367 is_linux = true |
| 347 is_mac = false | 368 is_mac = false |
| 348 is_nacl = false | 369 is_nacl = false |
| 349 is_posix = true | 370 is_posix = true |
| 350 is_win = false | 371 is_win = false |
| 351 } else if (current_os == "aix") { | 372 } else if (current_os == "aix") { |
| 352 is_android = false | 373 is_android = false |
| 353 is_chromeos = false | 374 is_chromeos = false |
| 354 is_ios = false | 375 is_ios = false |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 368 # to each assignment or appending to the sources variable and matches are | 389 # to each assignment or appending to the sources variable and matches are |
| 369 # automatically removed. | 390 # automatically removed. |
| 370 # | 391 # |
| 371 # Note that the patterns are NOT regular expressions. Only "*" and "\b" (path | 392 # Note that the patterns are NOT regular expressions. Only "*" and "\b" (path |
| 372 # boundary = end of string or slash) are supported, and the entire string | 393 # boundary = end of string or slash) are supported, and the entire string |
| 373 # must match the pattern (so you need "*.cc" to match all .cc files, for | 394 # must match the pattern (so you need "*.cc" to match all .cc files, for |
| 374 # example). | 395 # example). |
| 375 | 396 |
| 376 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call | 397 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call |
| 377 # below. | 398 # below. |
| 378 sources_assignment_filter = [] | 399 sources_assignment_filter = [] |
|
miu
2017/05/11 21:18:11
Given recent discussion in the "Fuchsia porting gu
scottmg
2017/05/11 21:24:53
That might be pleasant, but per Brett's comment, w
| |
| 379 if (!is_posix) { | 400 if (!is_posix) { |
| 380 sources_assignment_filter += [ | 401 sources_assignment_filter += [ |
| 381 "*_posix.h", | 402 "*_posix.h", |
| 382 "*_posix.cc", | 403 "*_posix.cc", |
| 383 "*_posix_unittest.h", | 404 "*_posix_unittest.h", |
| 384 "*_posix_unittest.cc", | 405 "*_posix_unittest.cc", |
| 385 "*\bposix/*", | 406 "*\bposix/*", |
| 386 ] | 407 ] |
| 387 } | 408 } |
| 388 | 409 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 669 set_defaults("component") { | 690 set_defaults("component") { |
| 670 if (is_component_build) { | 691 if (is_component_build) { |
| 671 configs = default_shared_library_configs | 692 configs = default_shared_library_configs |
| 672 if (is_android) { | 693 if (is_android) { |
| 673 configs -= [ "//build/config/android:hide_all_but_jni_onload" ] | 694 configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 674 } | 695 } |
| 675 } else { | 696 } else { |
| 676 configs = default_compiler_configs | 697 configs = default_compiler_configs |
| 677 } | 698 } |
| 678 } | 699 } |
| OLD | NEW |