1# All targets will get this list of configs by default.
2# Targets can opt out of a config by removing it from their local configs list.
3# If you're adding global flags and don't need targets to be able to opt out,
4# add the flags to compiler_defaults, not to a new config.
5shared_binary_target_configs = [
6  "//llvm/utils/gn/build:compiler_defaults",
7  "//llvm/utils/gn/build:llvm_code",
8  "//llvm/utils/gn/build:no_exceptions",
9  "//llvm/utils/gn/build:no_rtti",
10  "//llvm/utils/gn/build:thin_archive",
11  "//llvm/utils/gn/build:warn_covered_switch_default",
12]
13
14# Apply that default list to the binary target types.
15set_defaults("executable") {
16  configs = shared_binary_target_configs
17}
18set_defaults("loadable_module") {
19  configs = shared_binary_target_configs
20}
21set_defaults("static_library") {
22  configs = shared_binary_target_configs
23}
24set_defaults("shared_library") {
25  configs = shared_binary_target_configs
26}
27set_defaults("source_set") {
28  configs = shared_binary_target_configs
29}
30
31if (target_os == "") {
32  target_os = host_os
33}
34if (current_os == "") {
35  current_os = target_os
36}
37
38if (target_cpu == "") {
39  target_cpu = host_cpu
40}
41if (current_cpu == "") {
42  current_cpu = target_cpu
43}
44
45if (host_os == "win") {
46  host_toolchain = "//llvm/utils/gn/build/toolchain:win"
47} else {
48  host_toolchain = "//llvm/utils/gn/build/toolchain:unix"
49}
50
51set_default_toolchain(host_toolchain)
52