BUILD 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # Copyright 2018 The Bazel Authors. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # This becomes the BUILD file for @local_config_cc// under Windows.
  15. package(default_visibility = ["//visibility:public"])
  16. load(":cc_toolchain_config.bzl", "cc_toolchain_config")
  17. cc_library(
  18. name = "malloc",
  19. )
  20. filegroup(
  21. name = "empty",
  22. srcs = [],
  23. )
  24. # Hardcoded toolchain, legacy behaviour.
  25. cc_toolchain_suite(
  26. name = "toolchain",
  27. toolchains = {
  28. "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
  29. "x64_windows|msvc-cl": ":cc-compiler-x64_windows",
  30. "x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys",
  31. "x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw",
  32. "x64_windows_msys": ":cc-compiler-x64_windows_msys",
  33. "x64_windows": ":cc-compiler-x64_windows",
  34. "armeabi-v7a": ":cc-compiler-armeabi-v7a",
  35. },
  36. )
  37. cc_toolchain(
  38. name = "cc-compiler-x64_windows_msys",
  39. all_files = ":empty",
  40. ar_files = ":empty",
  41. as_files = ":empty",
  42. compiler_files = ":empty",
  43. dwp_files = ":empty",
  44. linker_files = ":empty",
  45. objcopy_files = ":empty",
  46. strip_files = ":empty",
  47. supports_param_files = 1,
  48. toolchain_config = ":msys_x64",
  49. toolchain_identifier = "msys_x64",
  50. )
  51. cc_toolchain_config(
  52. name = "msys_x64",
  53. compiler = "msys-gcc",
  54. cpu = "x64_windows",
  55. )
  56. toolchain(
  57. name = "cc-toolchain-x64_windows_msys",
  58. exec_compatible_with = [
  59. "@bazel_tools//platforms:x86_64",
  60. "@bazel_tools//platforms:windows",
  61. "@bazel_tools//tools/cpp:msys",
  62. ],
  63. target_compatible_with = [
  64. "@bazel_tools//platforms:x86_64",
  65. "@bazel_tools//platforms:windows",
  66. ],
  67. toolchain = ":cc-compiler-x64_windows_msys",
  68. toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
  69. )
  70. cc_toolchain(
  71. name = "cc-compiler-x64_windows_mingw",
  72. all_files = ":empty",
  73. ar_files = ":empty",
  74. as_files = ":empty",
  75. compiler_files = ":empty",
  76. dwp_files = ":empty",
  77. linker_files = ":empty",
  78. objcopy_files = ":empty",
  79. strip_files = ":empty",
  80. supports_param_files = 0,
  81. toolchain_config = ":msys_x64_mingw",
  82. toolchain_identifier = "msys_x64_mingw",
  83. )
  84. cc_toolchain_config(
  85. name = "msys_x64_mingw",
  86. compiler = "mingw-gcc",
  87. cpu = "x64_windows",
  88. )
  89. toolchain(
  90. name = "cc-toolchain-x64_windows_mingw",
  91. exec_compatible_with = [
  92. "@bazel_tools//platforms:x86_64",
  93. "@bazel_tools//platforms:windows",
  94. "@bazel_tools//tools/cpp:mingw",
  95. ],
  96. target_compatible_with = [
  97. "@bazel_tools//platforms:x86_64",
  98. "@bazel_tools//platforms:windows",
  99. ],
  100. toolchain = ":cc-compiler-x64_windows_mingw",
  101. toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
  102. )
  103. cc_toolchain(
  104. name = "cc-compiler-x64_windows",
  105. all_files = ":empty",
  106. ar_files = ":empty",
  107. as_files = ":empty",
  108. compiler_files = ":empty",
  109. dwp_files = ":empty",
  110. linker_files = ":empty",
  111. objcopy_files = ":empty",
  112. strip_files = ":empty",
  113. supports_param_files = 1,
  114. toolchain_config = ":msvc_x64",
  115. toolchain_identifier = "msvc_x64",
  116. )
  117. cc_toolchain_config(
  118. name = "msvc_x64",
  119. compiler = "msvc-cl",
  120. cpu = "x64_windows",
  121. )
  122. toolchain(
  123. name = "cc-toolchain-x64_windows",
  124. exec_compatible_with = [
  125. "@bazel_tools//platforms:x86_64",
  126. "@bazel_tools//platforms:windows",
  127. ],
  128. target_compatible_with = [
  129. "@bazel_tools//platforms:x86_64",
  130. "@bazel_tools//platforms:windows",
  131. ],
  132. toolchain = ":cc-compiler-x64_windows",
  133. toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
  134. )
  135. cc_toolchain(
  136. name = "cc-compiler-armeabi-v7a",
  137. all_files = ":empty",
  138. ar_files = ":empty",
  139. as_files = ":empty",
  140. compiler_files = ":empty",
  141. dwp_files = ":empty",
  142. linker_files = ":empty",
  143. objcopy_files = ":empty",
  144. strip_files = ":empty",
  145. supports_param_files = 1,
  146. toolchain_config = ":stub_armeabi-v7a",
  147. toolchain_identifier = "stub_armeabi-v7a",
  148. )
  149. cc_toolchain_config(
  150. name = "stub_armeabi-v7a",
  151. compiler = "compiler",
  152. cpu = "armeabi-v7a",
  153. )
  154. toolchain(
  155. name = "cc-toolchain-armeabi-v7a",
  156. exec_compatible_with = [
  157. ],
  158. target_compatible_with = [
  159. "@bazel_tools//platforms:arm",
  160. "@bazel_tools//platforms:android",
  161. ],
  162. toolchain = ":cc-compiler-armeabi-v7a",
  163. toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
  164. )
  165. filegroup(
  166. name = "link_dynamic_library",
  167. srcs = ["link_dynamic_library.sh"],
  168. )