Chromium Code Reviews| Index: build/config/BUILDCONFIG.gn |
| diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn |
| index d055e705627c96782434537d0157594ff4f6dad0..9fee5904ca7a3a3872f4ca1ded7433ead61a1193 100644 |
| --- a/build/config/BUILDCONFIG.gn |
| +++ b/build/config/BUILDCONFIG.gn |
| @@ -69,6 +69,13 @@ if (current_os == "") { |
| current_os = target_os |
| } |
| +# Checks whether we are running on a Power or z System. |
| +# This is used many times in multiple files and the four parts |
| +# of the clause almost always go together. |
| +# Creating a helper variable vastly improves readability. |
|
brettw
2017/04/26 20:07:42
I think this line:
"Creating a helper variable vas
rayb
2017/04/27 19:29:45
Done.
|
| +is_power_or_z = current_cpu == "s390x" || current_cpu == "s390" || |
|
brettw
2017/04/26 20:07:42
If we're going to keep this here, it should be cal
rayb
2017/04/27 19:29:45
Done.
|
| + current_cpu == "ppc64" || current_cpu == "ppc" |
| + |
| # ============================================================================= |
| # BUILD FLAGS |
| # ============================================================================= |
| @@ -135,8 +142,9 @@ declare_args() { |
| # Set to true when compiling with the Clang compiler. Typically this is used |
| # to configure warnings. |
| - is_clang = current_os == "mac" || current_os == "ios" || |
| - current_os == "linux" || current_os == "chromeos" |
| + is_clang = |
| + current_os == "mac" || current_os == "ios" || current_os == "chromeos" || |
| + (current_os == "linux" && !is_power_or_z) |
| # Allows the path to a custom target toolchain to be injected as a single |
| # argument, and set as the default toolchain. |
| @@ -207,6 +215,8 @@ if (host_toolchain == "") { |
| } else { |
| host_toolchain = "//build/toolchain/win:$target_cpu" |
| } |
| + } else if (host_os == "aix") { |
| + host_toolchain = "//build/toolchain/aix:$host_cpu" |
| } else { |
| assert(false, "Unsupported host_os: $host_os") |
| } |
| @@ -242,6 +252,8 @@ if (target_os == "android") { |
| } else { |
| _default_toolchain = "//build/toolchain/win:$target_cpu" |
| } |
| +} else if (target_os == "aix") { |
| + _default_toolchain = "//build/toolchain/aix:$target_cpu" |
| } else if (target_os == "winrt_81" || target_os == "winrt_81_phone" || |
| target_os == "winrt_10") { |
| _default_toolchain = "//build/toolchain/win:winrt_$target_cpu" |
| @@ -342,6 +354,15 @@ if (current_os == "win" || current_os == "winrt_81" || |
| is_nacl = false |
| is_posix = true |
| is_win = false |
| +} else if (current_os == "aix") { |
| + is_android = false |
| + is_chromeos = false |
| + is_ios = false |
| + is_linux = false |
| + is_mac = false |
| + is_nacl = false |
| + is_posix = true |
| + is_win = false |
| } |
| # ============================================================================= |
| @@ -370,6 +391,7 @@ if (!is_posix) { |
| "*\bposix/*", |
| ] |
| } |
| + |
| if (!is_win) { |
| sources_assignment_filter += [ |
| "*_win.cc", |
| @@ -498,11 +520,13 @@ if (current_os == "winrt_81" || current_os == "winrt_81_phone" || |
| current_os == "winrt_10") { |
| default_compiler_configs += [ "//build/config/win:target_winrt" ] |
| } |
| + |
| if (is_posix) { |
| - default_compiler_configs += [ |
| - "//build/config/gcc:no_exceptions", |
| - "//build/config/gcc:symbol_visibility_hidden", |
| - ] |
| + default_compiler_configs += [ "//build/config/gcc:no_exceptions" ] |
| + if (current_os != "aix") { |
| + default_compiler_configs += |
| + [ "//build/config/gcc:symbol_visibility_hidden" ] |
| + } |
| } |
| if (is_android) { |