Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

131 rinda
3.5 KiB

  1. # Copyright (c) 2016, Google Inc.
  2. #
  3. # Permission to use, copy, modify, and/or distribute this software for any
  4. # purpose with or without fee is hereby granted, provided that the above
  5. # copyright notice and this permission notice appear in all copies.
  6. #
  7. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. licenses(["notice"])
  15. exports_files(["LICENSE"])
  16. load(
  17. ":BUILD.generated.bzl",
  18. "crypto_headers",
  19. "crypto_internal_headers",
  20. "crypto_sources",
  21. "crypto_sources_linux_x86_64",
  22. "crypto_sources_mac_x86_64",
  23. "ssl_headers",
  24. "ssl_internal_headers",
  25. "ssl_c_sources",
  26. "ssl_cc_sources",
  27. "tool_sources",
  28. "tool_headers",
  29. )
  30. config_setting(
  31. name = "linux_x86_64",
  32. values = {"cpu": "k8"},
  33. )
  34. config_setting(
  35. name = "mac_x86_64",
  36. values = {"cpu": "darwin"},
  37. )
  38. boringssl_copts = [
  39. # Assembler option --noexecstack adds .note.GNU-stack to each object to
  40. # ensure that binaries can be built with non-executable stack.
  41. "-Wa,--noexecstack",
  42. # This is needed on Linux systems (at least) to get rwlock in pthread.
  43. "-D_XOPEN_SOURCE=700",
  44. # This list of warnings should match those in the top-level CMakeLists.txt.
  45. "-Wall",
  46. "-Werror",
  47. "-Wformat=2",
  48. "-Wsign-compare",
  49. "-Wmissing-field-initializers",
  50. "-Wwrite-strings",
  51. "-Wshadow",
  52. "-fno-common",
  53. # Modern build environments should be able to set this to use atomic
  54. # operations for reference counting rather than locks. However, it's
  55. # known not to work on some Android builds.
  56. # "-DOPENSSL_C11_ATOMIC",
  57. ] + select({
  58. ":linux_x86_64": [],
  59. ":mac_x86_64": [],
  60. "//conditions:default": ["-DOPENSSL_NO_ASM"],
  61. })
  62. crypto_sources_asm = select({
  63. ":linux_x86_64": crypto_sources_linux_x86_64,
  64. ":mac_x86_64": crypto_sources_mac_x86_64,
  65. "//conditions:default": [],
  66. })
  67. # For C targets only (not C++), compile with C11 support.
  68. boringssl_copts_c11 = boringssl_copts + [
  69. "-std=c11",
  70. "-Wmissing-prototypes",
  71. "-Wold-style-definition",
  72. "-Wstrict-prototypes",
  73. ]
  74. # For C targets only (not C++), compile with C11 support.
  75. boringssl_copts_cxx = boringssl_copts + [
  76. "-std=c++11",
  77. "-Wmissing-declarations",
  78. ]
  79. cc_library(
  80. name = "crypto",
  81. srcs = crypto_sources + crypto_internal_headers + crypto_sources_asm,
  82. hdrs = crypto_headers,
  83. copts = boringssl_copts_c11,
  84. includes = ["src/include"],
  85. linkopts = select({
  86. ":mac_x86_64": [],
  87. "//conditions:default": ["-lpthread"],
  88. }),
  89. visibility = ["//visibility:public"],
  90. )
  91. cc_library(
  92. name = "ssl",
  93. srcs = ssl_c_sources + ssl_internal_headers,
  94. hdrs = ssl_headers,
  95. copts = boringssl_copts_c11,
  96. includes = ["src/include"],
  97. visibility = ["//visibility:public"],
  98. deps = [":crypto", ":ssl_cc"],
  99. )
  100. cc_library(
  101. name = "ssl_cc",
  102. srcs = ssl_cc_sources + ssl_internal_headers,
  103. hdrs = ssl_headers,
  104. copts = boringssl_copts,
  105. includes = ["src/include"],
  106. deps = [":crypto"],
  107. )
  108. cc_binary(
  109. name = "bssl",
  110. srcs = tool_sources + tool_headers,
  111. copts = boringssl_copts_cxx,
  112. visibility = ["//visibility:public"],
  113. deps = [":ssl"],
  114. )