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.
 
 
 
 
 
 

121 rinda
3.3 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_sources",
  26. "tool_sources",
  27. "tool_headers",
  28. )
  29. config_setting(
  30. name = "linux_x86_64",
  31. values = {"cpu": "k8"},
  32. )
  33. config_setting(
  34. name = "mac_x86_64",
  35. values = {"cpu": "darwin"},
  36. )
  37. boringssl_copts = [
  38. # Assembler option --noexecstack adds .note.GNU-stack to each object to
  39. # ensure that binaries can be built with non-executable stack.
  40. "-Wa,--noexecstack",
  41. # This is needed on Linux systems (at least) to get rwlock in pthread.
  42. "-D_XOPEN_SOURCE=700",
  43. # This list of warnings should match those in the top-level CMakeLists.txt.
  44. "-Wall",
  45. "-Werror",
  46. "-Wformat=2",
  47. "-Wsign-compare",
  48. "-Wmissing-field-initializers",
  49. "-Wwrite-strings",
  50. "-Wshadow",
  51. "-fno-common",
  52. # Modern build environments should be able to set this to use atomic
  53. # operations for reference counting rather than locks. However, it's
  54. # known not to work on some Android builds.
  55. # "-DOPENSSL_C11_ATOMIC",
  56. ] + select({
  57. ":linux_x86_64": [],
  58. ":mac_x86_64": [],
  59. "//conditions:default": ["-DOPENSSL_NO_ASM"],
  60. })
  61. crypto_sources_asm = select({
  62. ":linux_x86_64": crypto_sources_linux_x86_64,
  63. ":mac_x86_64": crypto_sources_mac_x86_64,
  64. "//conditions:default": [],
  65. })
  66. # For C targets only (not C++), compile with C11 support.
  67. boringssl_copts_c11 = boringssl_copts + [
  68. "-std=c11",
  69. "-Wmissing-prototypes",
  70. "-Wold-style-definition",
  71. "-Wstrict-prototypes",
  72. ]
  73. # For C targets only (not C++), compile with C11 support.
  74. boringssl_copts_cxx = boringssl_copts + [
  75. "-std=c++11",
  76. "-Wmissing-declarations",
  77. ]
  78. cc_library(
  79. name = "crypto",
  80. srcs = crypto_sources + crypto_internal_headers + crypto_sources_asm,
  81. hdrs = crypto_headers,
  82. copts = boringssl_copts_c11,
  83. includes = ["src/include"],
  84. linkopts = select({
  85. ":mac_x86_64": [],
  86. "//conditions:default": ["-lpthread"],
  87. }),
  88. visibility = ["//visibility:public"],
  89. )
  90. cc_library(
  91. name = "ssl",
  92. srcs = ssl_sources + ssl_internal_headers,
  93. hdrs = ssl_headers,
  94. copts = boringssl_copts_c11,
  95. includes = ["src/include"],
  96. visibility = ["//visibility:public"],
  97. deps = [":crypto"],
  98. )
  99. cc_binary(
  100. name = "bssl",
  101. srcs = tool_sources + tool_headers,
  102. copts = boringssl_copts_cxx,
  103. visibility = ["//visibility:public"],
  104. deps = [":ssl"],
  105. )