Browse Source

Fix Bazel build and make it work on Windows.

Change-Id: Ie40ce2f7c828e9f639a996e56a4d3a014c05d701
Reviewed-on: https://boringssl-review.googlesource.com/18544
Reviewed-by: Yun Peng <pcloudy@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Yun Peng <pcloudy@google.com>
kris/onging/CECPQ3_patch15
Yun Peng 7 years ago
committed by Adam Langley
parent
commit
d363247f1e
1 changed files with 36 additions and 21 deletions
  1. +36
    -21
      util/BUILD.toplevel

+ 36
- 21
util/BUILD.toplevel View File

@@ -26,8 +26,7 @@ load(
"fips_fragments", "fips_fragments",
"ssl_headers", "ssl_headers",
"ssl_internal_headers", "ssl_internal_headers",
"ssl_c_sources",
"ssl_cc_sources",
"ssl_sources",
"tool_sources", "tool_sources",
"tool_headers", "tool_headers",
) )
@@ -42,7 +41,12 @@ config_setting(
values = {"cpu": "darwin"}, values = {"cpu": "darwin"},
) )


boringssl_copts = [
config_setting(
name = "windows_x86_64",
values = {"cpu": "x64_windows"},
)

posix_copts = [
# Assembler option --noexecstack adds .note.GNU-stack to each object to # Assembler option --noexecstack adds .note.GNU-stack to each object to
# ensure that binaries can be built with non-executable stack. # ensure that binaries can be built with non-executable stack.
"-Wa,--noexecstack", "-Wa,--noexecstack",
@@ -64,9 +68,15 @@ boringssl_copts = [
# operations for reference counting rather than locks. However, it's # operations for reference counting rather than locks. However, it's
# known not to work on some Android builds. # known not to work on some Android builds.
# "-DOPENSSL_C11_ATOMIC", # "-DOPENSSL_C11_ATOMIC",
] + select({
":linux_x86_64": [],
":mac_x86_64": [],
]

boringssl_copts = select({
":linux_x86_64": posix_copts,
":mac_x86_64": posix_copts,
":windows_x86_64": [
"-DWIN32_LEAN_AND_MEAN",
"-DOPENSSL_NO_ASM",
],
"//conditions:default": ["-DOPENSSL_NO_ASM"], "//conditions:default": ["-DOPENSSL_NO_ASM"],
}) })


@@ -77,19 +87,31 @@ crypto_sources_asm = select({
}) })


# For C targets only (not C++), compile with C11 support. # For C targets only (not C++), compile with C11 support.
boringssl_copts_c11 = boringssl_copts + [
posix_copts_c11 = [
"-std=c11", "-std=c11",
"-Wmissing-prototypes", "-Wmissing-prototypes",
"-Wold-style-definition", "-Wold-style-definition",
"-Wstrict-prototypes", "-Wstrict-prototypes",
] ]


# For C targets only (not C++), compile with C11 support.
boringssl_copts_cxx = boringssl_copts + [
boringssl_copts_c11 = boringssl_copts + select({
":linux_x86_64": posix_copts_c11,
":mac_x86_64": posix_copts_c11,
"//conditions:default": [],
})

# For C++ targets only (not C), compile with C++11 support.
posix_copts_cxx = [
"-std=c++11", "-std=c++11",
"-Wmissing-declarations", "-Wmissing-declarations",
] ]


boringssl_copts_cxx = boringssl_copts + select({
":linux_x86_64": posix_copts_cxx,
":mac_x86_64": posix_copts_cxx,
"//conditions:default": [],
})

cc_library( cc_library(
name = "crypto", name = "crypto",
srcs = crypto_sources + crypto_internal_headers + crypto_sources_asm, srcs = crypto_sources + crypto_internal_headers + crypto_sources_asm,
@@ -105,21 +127,14 @@ cc_library(


cc_library( cc_library(
name = "ssl", name = "ssl",
srcs = ssl_c_sources + ssl_internal_headers,
srcs = ssl_sources + ssl_internal_headers,
hdrs = ssl_headers, hdrs = ssl_headers,
copts = boringssl_copts_c11,
copts = boringssl_copts_cxx,
includes = ["src/include"], includes = ["src/include"],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [":crypto", ":ssl_cc"],
)

cc_library(
name = "ssl_cc",
srcs = ssl_cc_sources + ssl_internal_headers,
hdrs = ssl_headers,
copts = boringssl_copts,
includes = ["src/include"],
deps = [":crypto"],
deps = [
":crypto",
],
) )


cc_binary( cc_binary(


Loading…
Cancel
Save