OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 if (target_os == "") { |
| 6 target_os = host_os |
| 7 } |
| 8 if (target_cpu == "") { |
| 9 target_cpu = host_cpu |
| 10 } |
| 11 if (current_cpu == "") { |
| 12 current_cpu = target_cpu |
| 13 } |
| 14 if (current_os == "") { |
| 15 current_os = target_os |
| 16 } |
| 17 |
5 # All binary targets will get this list of configs by default. | 18 # All binary targets will get this list of configs by default. |
6 _shared_binary_target_configs = [ "//build:compiler_defaults" ] | 19 _shared_binary_target_configs = [ "//build:compiler_defaults" ] |
7 | 20 |
8 # Apply that default list to the binary target types. | 21 # Apply that default list to the binary target types. |
9 set_defaults("executable") { | 22 set_defaults("executable") { |
10 configs = _shared_binary_target_configs | 23 configs = _shared_binary_target_configs |
11 | 24 |
12 # Executables get this additional configuration. | 25 # Executables get this additional configuration. |
13 configs += [ "//build:executable_ldconfig" ] | 26 configs += [ "//build:executable_ldconfig" ] |
14 } | 27 } |
15 set_defaults("static_library") { | 28 set_defaults("static_library") { |
16 configs = _shared_binary_target_configs | 29 configs = _shared_binary_target_configs |
17 } | 30 } |
18 set_defaults("shared_library") { | 31 set_defaults("shared_library") { |
19 configs = _shared_binary_target_configs | 32 configs = _shared_binary_target_configs |
20 } | 33 } |
21 set_defaults("source_set") { | 34 set_defaults("source_set") { |
22 configs = _shared_binary_target_configs | 35 configs = _shared_binary_target_configs |
23 } | 36 } |
24 | 37 |
25 set_default_toolchain("//build/toolchain:gcc") | 38 set_default_toolchain("//build/toolchain:gcc") |
OLD | NEW |