BUILDCONFIG.gn 1.3 KB

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