1 Star 0 Fork 25

张文迪/third_party_boringssl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
BUILD.gn 4.49 KB
一键复制 编辑 原始数据 按行查看 历史
张文迪 提交于 2022-09-03 15:51 +08:00 . 编入ramdisk避免init依赖失败
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
# Copyright (c) 2016, Google Inc.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
import("//build/ohos.gni")
import("//developtools/profiler/build/config.gni")
import("BUILD.generated.gni")
posix_copts = [
# Assembler option --noexecstack adds .note.GNU-stack to each object to
# ensure that binaries can be built with non-executable stack.
"-Wa,--noexecstack",
# This is needed on Linux systems (at least) to get rwlock in pthread.
"-D_XOPEN_SOURCE=700",
# This list of warnings should match those in the top-level CMakeLists.txt.
"-Wall",
"-Werror",
"-Wformat=2",
"-Wsign-compare",
"-Wmissing-field-initializers",
"-Wwrite-strings",
"-Wshadow",
"-fno-common",
# Modern build environments should be able to set this to use atomic
# operations for reference counting rather than locks. However, it's
# known not to work on some Android builds.
# "-DOPENSSL_C11_ATOMIC",
]
boringssl_copts = []
if (target_os == "linux" || target_os == "android" || target_os == "ohos") {
boringssl_copts += posix_copts
} else if (target_os == "win") {
boringssl_copts += [
"-DWIN32_LEAN_AND_MEAN",
"-DOPENSSL_NO_ASM",
]
} else {
boringssl_copts += [ "-DOPENSSL_NO_ASM" ]
}
crypto_sources_asm = []
if (target_os == "linux" || target_os == "android" || target_os == "ohos") {
if (target_cpu == "x64" || target_cpu == "x86_64") {
crypto_sources_asm += crypto_sources_linux_x86_64
} else if (target_cpu == "x86") {
crypto_sources_asm += crypto_sources_linux_x86
}
# add ARM assembly code:
if (target_cpu == "arm") {
crypto_sources_asm += crypto_sources_linux_arm
} else if (target_cpu == "arm64") {
crypto_sources_asm += crypto_sources_linux_aarch64
}
} else if (target_os == "mac") {
crypto_sources_asm += crypto_sources_mac_x86_64
}
# for OHOS host toolchain
if (current_toolchain == host_toolchain) {
crypto_sources_asm += crypto_sources_linux_x86_64
}
# For C targets only (not C++), compile with C11 support.
posix_copts_c11 = [
"-std=c11",
"-Wmissing-prototypes",
"-Wold-style-definition",
"-Wstrict-prototypes",
]
boringssl_copts_c11 = boringssl_copts
if (target_os == "linux" || target_os == "android" || target_os == "ohos" ||
target_os == "mac") {
boringssl_copts_c11 += posix_copts_c11
}
# For C++ targets only (not C), compile with C++11 support.
#posix_copts_cxx = [
# "-std=c++11",
# "-Wmissing-declarations",
#]
boringssl_copts_cxx = boringssl_copts
#if (target_os == "linux" || target_os == "android" || target_os == "ohos" ||
# target_os == "mac") {
# boringssl_copts_c11 += posix_copts_cxx
#}
config("boringssl_config") {
include_dirs = [ "src/include" ]
}
ohos_shared_library("crypto") {
sources = crypto_sources + crypto_sources_asm
cflags_c = boringssl_copts_c11
# include_dirs = ["src/include"]
public_configs = [ ":boringssl_config" ]
if (target_os == "android" || target_os == "ohos" || target_os == "mac") {
ldflags = []
} else if (target_os == "windows") {
ldflags = [ "-defaultlib:advapi32.lib" ]
} else {
ldflags = [ "-lpthread" ]
}
install_enable = true
install_images = [
"system",
"ramdisk",
"updater",
]
subsystem_name = "thirdparty"
part_name = "boringssl"
}
ohos_shared_library("ssl") {
sources = ssl_sources
cflags = boringssl_copts_cxx
# include_dirs = ["src/include"]
public_configs = [ ":boringssl_config" ]
deps = [ ":crypto" ]
install_enable = true
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
part_name = "${OHOS_PROFILER_PART_NAME}"
}
#ohos_executable("bssl") {
# sources = tool_sources + tool_headers
# cflags = boringssl_copts_cxx
# include_dirs = ["src/include"]
# public_configs = [ ":boringssl_config" ]
# deps = [
# ":crypto",
# ":ssl",
# ]
#}
group("boringssl") {
deps = [
":crypto",
":ssl",
]
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wz109/third_party_boringssl.git
git@gitee.com:wz109/third_party_boringssl.git
wz109
third_party_boringssl
third_party_boringssl
master

搜索帮助