BUILD.gn 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # Copyright 2015 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. import("//build/buildflag_header.gni")
  5. import("//components/nacl/features.gni")
  6. import("//mojo/public/tools/bindings/mojom.gni")
  7. if (enable_nacl) {
  8. # This is separate so it can be used by ../broker:nacl64.
  9. static_library("minimal") {
  10. sources = [
  11. "nacl_cmd_line.cc",
  12. "nacl_cmd_line.h",
  13. "nacl_constants.cc",
  14. "nacl_constants.h",
  15. "nacl_messages.cc",
  16. "nacl_messages.h",
  17. "nacl_process_type.h",
  18. "nacl_service.cc",
  19. "nacl_service.h",
  20. "nacl_types.cc",
  21. "nacl_types.h",
  22. "nacl_types_param_traits.cc",
  23. "nacl_types_param_traits.h",
  24. ]
  25. public_deps = [
  26. ":minimal_content_dummy",
  27. ":switches",
  28. "//ipc",
  29. "//sandbox/policy",
  30. ]
  31. deps = [
  32. "//base",
  33. "//base:base_static",
  34. "//content/public/common:content_descriptors",
  35. "//mojo/core/embedder",
  36. "//native_client/src/trusted/error_code",
  37. "//services/service_manager/public/cpp",
  38. ]
  39. }
  40. # This exists just to make 'gn check' happy with :minimal. It can't
  41. # depend on //content/public/common or anything like that, because that
  42. # would bring in lots more than counts as "minimal" (stuff that should
  43. # not be in the nacl64.exe build).
  44. source_set("minimal_content_dummy") {
  45. check_includes = false
  46. sources = [
  47. "//content/public/common/content_descriptors.h",
  48. "//content/public/common/content_switches.h",
  49. "//content/public/common/process_type.h",
  50. ]
  51. # Deps required by the above headers.
  52. deps = [ "//media:media_buildflags" ]
  53. }
  54. static_library("common") {
  55. sources = [
  56. "nacl_host_messages.cc",
  57. "nacl_host_messages.h",
  58. "pnacl_types.cc",
  59. "pnacl_types.h",
  60. ]
  61. public_deps = [
  62. ":minimal",
  63. ":mojo_bindings",
  64. ":switches",
  65. "//ipc",
  66. ]
  67. deps = [
  68. "//base",
  69. "//build:chromeos_buildflags",
  70. "//url",
  71. "//url/ipc:url_ipc",
  72. ]
  73. if (is_linux || is_chromeos) {
  74. sources += [
  75. "nacl_paths.cc",
  76. "nacl_paths.h",
  77. ]
  78. defines = [ "__STDC_LIMIT_MACROS=1" ]
  79. deps += [ "//content/common:sandbox_support_linux" ]
  80. }
  81. }
  82. source_set("debug_exception_handler") {
  83. sources = []
  84. deps = [ "//base" ]
  85. if (is_win) {
  86. sources += [
  87. "nacl_debug_exception_handler_win.cc",
  88. "nacl_debug_exception_handler_win.h",
  89. ]
  90. }
  91. }
  92. mojom("mojo_bindings") {
  93. sources = [ "nacl.mojom" ]
  94. cpp_typemaps = [
  95. {
  96. types = [
  97. {
  98. mojom = "nacl.mojom.NaClErrorCode"
  99. cpp = "::NaClErrorCode"
  100. },
  101. ]
  102. traits_headers =
  103. [ "//native_client/src/trusted/service_runtime/nacl_error_code.h" ]
  104. traits_private_headers =
  105. [ "//components/nacl/common/nacl_types_param_traits.h" ]
  106. traits_public_deps = [
  107. ":minimal",
  108. "//native_client/src/trusted/error_code",
  109. ]
  110. traits_deps = [ "//ipc" ]
  111. },
  112. ]
  113. }
  114. }
  115. # Depending on this allows targets to unconditionally include
  116. # nacl_process_type.h without testing whether nacl is enabled.
  117. source_set("process_type") {
  118. public = [ "nacl_process_type.h" ]
  119. deps = [ "//content/public/common" ]
  120. }
  121. static_library("switches") {
  122. sources = [
  123. "nacl_switches.cc",
  124. "nacl_switches.h",
  125. ]
  126. }
  127. buildflag_header("buildflags") {
  128. header = "buildflags.h"
  129. flags = [ "ENABLE_NACL=$enable_nacl" ]
  130. }