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.
5 shared_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",
14 # Apply that default list to the binary target types.
15 set_defaults("executable") {
16 configs = shared_binary_target_configs
18 set_defaults("loadable_module") {
19 configs = shared_binary_target_configs
21 set_defaults("static_library") {
22 configs = shared_binary_target_configs
24 set_defaults("shared_library") {
25 configs = shared_binary_target_configs + [ "//llvm/utils/gn/build:zdefs" ]
27 set_defaults("source_set") {
28 configs = shared_binary_target_configs
31 if (target_os == "") {
34 if (current_os == "") {
35 current_os = target_os
38 if (target_cpu == "") {
41 if (current_cpu == "") {
42 current_cpu = target_cpu
45 if (host_os == "win") {
46 host_toolchain = "//llvm/utils/gn/build/toolchain:win"
48 host_toolchain = "//llvm/utils/gn/build/toolchain:unix"
51 set_default_toolchain(host_toolchain)
53 if (current_os == "android") {
60 template(target_type) {
61 target(target_type, target_name) {
62 forward_variables_from(invoker, "*")
66 deps += [ "//llvm/utils/gn/build/libs/implicit" ]