brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 0473d45 Raw
71 lines · plain
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_configs17}18set_defaults("loadable_module") {19  configs = shared_binary_target_configs20}21set_defaults("static_library") {22  configs = shared_binary_target_configs23}24set_defaults("shared_library") {25  configs = shared_binary_target_configs + [ "//llvm/utils/gn/build:zdefs" ]26}27set_defaults("source_set") {28  configs = shared_binary_target_configs29}30 31if (target_os == "") {32  target_os = host_os33}34if (current_os == "") {35  current_os = target_os36}37 38if (target_cpu == "") {39  target_cpu = host_cpu40}41if (current_cpu == "") {42  current_cpu = target_cpu43}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 53if (current_os == "android") {54  foreach(target_type,55          [56            "executable",57            "loadable_module",58            "shared_library",59          ]) {60    template(target_type) {61      target(target_type, target_name) {62        forward_variables_from(invoker, "*")63        if (!defined(deps)) {64          deps = []65        }66        deps += [ "//llvm/utils/gn/build/libs/implicit" ]67      }68    }69  }70}71