| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 # release (!is_debug). This might be better expressed as a tri-state | 128 # release (!is_debug). This might be better expressed as a tri-state |
| 129 # (debug, release, official) but for historical reasons there are two | 129 # (debug, release, official) but for historical reasons there are two |
| 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 = current_os == "mac" || current_os == "ios" || | 138 is_clang = |
| 139 current_os == "linux" || current_os == "chromeos" | 139 current_os == "mac" || current_os == "ios" || current_os == "chromeos" || |
| 140 (current_os == "linux" && current_cpu != "s390x" && |
| 141 current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc") |
| 140 | 142 |
| 141 # Allows the path to a custom target toolchain to be injected as a single | 143 # Allows the path to a custom target toolchain to be injected as a single |
| 142 # argument, and set as the default toolchain. | 144 # argument, and set as the default toolchain. |
| 143 custom_toolchain = "" | 145 custom_toolchain = "" |
| 144 | 146 |
| 145 # This should not normally be set as a build argument. It's here so that | 147 # This should not normally be set as a build argument. It's here so that |
| 146 # every toolchain can pass through the "global" value via toolchain_args(). | 148 # every toolchain can pass through the "global" value via toolchain_args(). |
| 147 host_toolchain = "" | 149 host_toolchain = "" |
| 148 | 150 |
| 149 # DON'T ADD MORE FLAGS HERE. Read the comment above. | 151 # DON'T ADD MORE FLAGS HERE. Read the comment above. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } else if (host_os == "mac") { | 202 } else if (host_os == "mac") { |
| 201 host_toolchain = "//build/toolchain/mac:clang_$host_cpu" | 203 host_toolchain = "//build/toolchain/mac:clang_$host_cpu" |
| 202 } else if (host_os == "win") { | 204 } else if (host_os == "win") { |
| 203 # On Windows always use the target CPU for host builds. On the | 205 # On Windows always use the target CPU for host builds. On the |
| 204 # configurations we support this will always work and it saves build steps. | 206 # configurations we support this will always work and it saves build steps. |
| 205 if (is_clang) { | 207 if (is_clang) { |
| 206 host_toolchain = "//build/toolchain/win:clang_$target_cpu" | 208 host_toolchain = "//build/toolchain/win:clang_$target_cpu" |
| 207 } else { | 209 } else { |
| 208 host_toolchain = "//build/toolchain/win:$target_cpu" | 210 host_toolchain = "//build/toolchain/win:$target_cpu" |
| 209 } | 211 } |
| 212 } else if (host_os == "aix") { |
| 213 host_toolchain = "//build/toolchain/aix:$host_cpu" |
| 210 } else { | 214 } else { |
| 211 assert(false, "Unsupported host_os: $host_os") | 215 assert(false, "Unsupported host_os: $host_os") |
| 212 } | 216 } |
| 213 } | 217 } |
| 214 | 218 |
| 215 _default_toolchain = "" | 219 _default_toolchain = "" |
| 216 | 220 |
| 217 if (target_os == "android") { | 221 if (target_os == "android") { |
| 218 assert(host_os == "linux" || host_os == "mac", | 222 assert(host_os == "linux" || host_os == "mac", |
| 219 "Android builds are only supported on Linux and Mac hosts.") | 223 "Android builds are only supported on Linux and Mac hosts.") |
| (...skipping 15 matching lines...) Expand all Loading... |
| 235 assert(host_os == "mac", "Mac cross-compiles are unsupported.") | 239 assert(host_os == "mac", "Mac cross-compiles are unsupported.") |
| 236 _default_toolchain = host_toolchain | 240 _default_toolchain = host_toolchain |
| 237 } else if (target_os == "win") { | 241 } else if (target_os == "win") { |
| 238 # On Windows we use the same toolchain for host and target by default. | 242 # On Windows we use the same toolchain for host and target by default. |
| 239 assert(target_os == host_os, "Win cross-compiles only work on win hosts.") | 243 assert(target_os == host_os, "Win cross-compiles only work on win hosts.") |
| 240 if (is_clang) { | 244 if (is_clang) { |
| 241 _default_toolchain = "//build/toolchain/win:clang_$target_cpu" | 245 _default_toolchain = "//build/toolchain/win:clang_$target_cpu" |
| 242 } else { | 246 } else { |
| 243 _default_toolchain = "//build/toolchain/win:$target_cpu" | 247 _default_toolchain = "//build/toolchain/win:$target_cpu" |
| 244 } | 248 } |
| 249 } else if (target_os == "aix") { |
| 250 _default_toolchain = "//build/toolchain/aix:$target_cpu" |
| 245 } else if (target_os == "winrt_81" || target_os == "winrt_81_phone" || | 251 } else if (target_os == "winrt_81" || target_os == "winrt_81_phone" || |
| 246 target_os == "winrt_10") { | 252 target_os == "winrt_10") { |
| 247 _default_toolchain = "//build/toolchain/win:winrt_$target_cpu" | 253 _default_toolchain = "//build/toolchain/win:winrt_$target_cpu" |
| 248 } else { | 254 } else { |
| 249 assert(false, "Unsupported target_os: $target_os") | 255 assert(false, "Unsupported target_os: $target_os") |
| 250 } | 256 } |
| 251 | 257 |
| 252 # If a custom toolchain has been set in the args, set it as default. Otherwise, | 258 # If a custom toolchain has been set in the args, set it as default. Otherwise, |
| 253 # set the default toolchain for the platform (if any). | 259 # set the default toolchain for the platform (if any). |
| 254 if (custom_toolchain != "") { | 260 if (custom_toolchain != "") { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 is_win = false | 341 is_win = false |
| 336 } else if (current_os == "linux") { | 342 } else if (current_os == "linux") { |
| 337 is_android = false | 343 is_android = false |
| 338 is_chromeos = false | 344 is_chromeos = false |
| 339 is_ios = false | 345 is_ios = false |
| 340 is_linux = true | 346 is_linux = true |
| 341 is_mac = false | 347 is_mac = false |
| 342 is_nacl = false | 348 is_nacl = false |
| 343 is_posix = true | 349 is_posix = true |
| 344 is_win = false | 350 is_win = false |
| 351 } else if (current_os == "aix") { |
| 352 is_android = false |
| 353 is_chromeos = false |
| 354 is_ios = false |
| 355 is_linux = false |
| 356 is_mac = false |
| 357 is_nacl = false |
| 358 is_posix = true |
| 359 is_win = false |
| 345 } | 360 } |
| 346 | 361 |
| 347 # ============================================================================= | 362 # ============================================================================= |
| 348 # SOURCES FILTERS | 363 # SOURCES FILTERS |
| 349 # ============================================================================= | 364 # ============================================================================= |
| 350 # | 365 # |
| 351 # These patterns filter out platform-specific files when assigning to the | 366 # These patterns filter out platform-specific files when assigning to the |
| 352 # sources variable. The magic variable |sources_assignment_filter| is applied | 367 # sources variable. The magic variable |sources_assignment_filter| is applied |
| 353 # to each assignment or appending to the sources variable and matches are | 368 # to each assignment or appending to the sources variable and matches are |
| 354 # automatically removed. | 369 # automatically removed. |
| 355 # | 370 # |
| 356 # Note that the patterns are NOT regular expressions. Only "*" and "\b" (path | 371 # Note that the patterns are NOT regular expressions. Only "*" and "\b" (path |
| 357 # boundary = end of string or slash) are supported, and the entire string | 372 # boundary = end of string or slash) are supported, and the entire string |
| 358 # must match the pattern (so you need "*.cc" to match all .cc files, for | 373 # must match the pattern (so you need "*.cc" to match all .cc files, for |
| 359 # example). | 374 # example). |
| 360 | 375 |
| 361 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call | 376 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call |
| 362 # below. | 377 # below. |
| 363 sources_assignment_filter = [] | 378 sources_assignment_filter = [] |
| 364 if (!is_posix) { | 379 if (!is_posix) { |
| 365 sources_assignment_filter += [ | 380 sources_assignment_filter += [ |
| 366 "*_posix.h", | 381 "*_posix.h", |
| 367 "*_posix.cc", | 382 "*_posix.cc", |
| 368 "*_posix_unittest.h", | 383 "*_posix_unittest.h", |
| 369 "*_posix_unittest.cc", | 384 "*_posix_unittest.cc", |
| 370 "*\bposix/*", | 385 "*\bposix/*", |
| 371 ] | 386 ] |
| 372 } | 387 } |
| 388 |
| 373 if (!is_win) { | 389 if (!is_win) { |
| 374 sources_assignment_filter += [ | 390 sources_assignment_filter += [ |
| 375 "*_win.cc", | 391 "*_win.cc", |
| 376 "*_win.h", | 392 "*_win.h", |
| 377 "*_win_unittest.cc", | 393 "*_win_unittest.cc", |
| 378 "*\bwin/*", | 394 "*\bwin/*", |
| 379 "*.def", | 395 "*.def", |
| 380 "*.rc", | 396 "*.rc", |
| 381 ] | 397 ] |
| 382 } | 398 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 "//build/config/win:nominmax", | 507 "//build/config/win:nominmax", |
| 492 "//build/config/win:unicode", | 508 "//build/config/win:unicode", |
| 493 "//build/config/win:winver", | 509 "//build/config/win:winver", |
| 494 "//build/config/win:vs_code_analysis", | 510 "//build/config/win:vs_code_analysis", |
| 495 ] | 511 ] |
| 496 } | 512 } |
| 497 if (current_os == "winrt_81" || current_os == "winrt_81_phone" || | 513 if (current_os == "winrt_81" || current_os == "winrt_81_phone" || |
| 498 current_os == "winrt_10") { | 514 current_os == "winrt_10") { |
| 499 default_compiler_configs += [ "//build/config/win:target_winrt" ] | 515 default_compiler_configs += [ "//build/config/win:target_winrt" ] |
| 500 } | 516 } |
| 517 |
| 501 if (is_posix) { | 518 if (is_posix) { |
| 502 default_compiler_configs += [ | 519 default_compiler_configs += [ "//build/config/gcc:no_exceptions" ] |
| 503 "//build/config/gcc:no_exceptions", | 520 if (current_os != "aix") { |
| 504 "//build/config/gcc:symbol_visibility_hidden", | 521 default_compiler_configs += |
| 505 ] | 522 [ "//build/config/gcc:symbol_visibility_hidden" ] |
| 523 } |
| 506 } | 524 } |
| 507 | 525 |
| 508 if (is_android) { | 526 if (is_android) { |
| 509 default_compiler_configs += | 527 default_compiler_configs += |
| 510 [ "//build/config/android:default_cygprofile_instrumentation" ] | 528 [ "//build/config/android:default_cygprofile_instrumentation" ] |
| 511 } | 529 } |
| 512 | 530 |
| 513 if (is_clang && !is_nacl) { | 531 if (is_clang && !is_nacl) { |
| 514 default_compiler_configs += [ | 532 default_compiler_configs += [ |
| 515 "//build/config/clang:find_bad_constructs", | 533 "//build/config/clang:find_bad_constructs", |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 set_defaults("component") { | 669 set_defaults("component") { |
| 652 if (is_component_build) { | 670 if (is_component_build) { |
| 653 configs = default_shared_library_configs | 671 configs = default_shared_library_configs |
| 654 if (is_android) { | 672 if (is_android) { |
| 655 configs -= [ "//build/config/android:hide_all_but_jni_onload" ] | 673 configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 656 } | 674 } |
| 657 } else { | 675 } else { |
| 658 configs = default_compiler_configs | 676 configs = default_compiler_configs |
| 659 } | 677 } |
| 660 } | 678 } |
| OLD | NEW |