brettw@chromium.org | 45b211c | 2014-08-19 22:52:16 +0000 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
tsniatowski | b1a1959 | 2015-11-02 02:50:05 -0800 | [diff] [blame] | 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 | |
Harley Li | 981f46c | 2020-06-03 10:33:23 -0400 | [diff] [blame] | 18 | is_linux = host_os == "linux" && current_os == "linux" && target_os == "linux" |
| 19 | is_mac = host_os == "mac" && current_os == "mac" && target_os == "mac" |
| 20 | |
brettw@chromium.org | 45b211c | 2014-08-19 22:52:16 +0000 | [diff] [blame] | 21 | # All binary targets will get this list of configs by default. |
scottmg | fb9da23 | 2014-12-03 15:27:24 -0800 | [diff] [blame] | 22 | _shared_binary_target_configs = [ "//build:compiler_defaults" ] |
brettw@chromium.org | 45b211c | 2014-08-19 22:52:16 +0000 | [diff] [blame] | 23 | |
| 24 | # Apply that default list to the binary target types. |
| 25 | set_defaults("executable") { |
| 26 | configs = _shared_binary_target_configs |
scottmg | fb9da23 | 2014-12-03 15:27:24 -0800 | [diff] [blame] | 27 | |
brettw@chromium.org | 45b211c | 2014-08-19 22:52:16 +0000 | [diff] [blame] | 28 | # Executables get this additional configuration. |
| 29 | configs += [ "//build:executable_ldconfig" ] |
| 30 | } |
| 31 | set_defaults("static_library") { |
| 32 | configs = _shared_binary_target_configs |
| 33 | } |
| 34 | set_defaults("shared_library") { |
| 35 | configs = _shared_binary_target_configs |
| 36 | } |
| 37 | set_defaults("source_set") { |
| 38 | configs = _shared_binary_target_configs |
| 39 | } |
| 40 | |
| 41 | set_default_toolchain("//build/toolchain:gcc") |