1+ # Copyright (C) 2019 Intel Corporation. All rights reserved.
2+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+ message (STATUS "involving boringssl..." )
5+
6+ include (ExternalProject)
7+
8+ ExternalProject_Add(boringssl
9+ PREFIX external/boringssl
10+ # follow envoy, which tracks BoringSSL, which tracks Chromium
11+ # https://github.com/envoyproxy/envoy/blob/main/bazel/repository_locations.bzl#L112
12+ # chromium-105.0.5195.37 (linux/beta)
13+ URL https://github.com/google/boringssl/archive/098695591f3a2665fccef83a3732ecfc99acdcdd.tar.gz
14+ URL_HASH SHA256=e141448cf6f686b6e9695f6b6459293fd602c8d51efe118a83106752cf7e1280
15+ DOWNLOAD_EXTRACT_TIMESTAMP NEW
16+ # SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../external/boringssl
17+ INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/src/boringssl-build /libssl.a
18+ ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/
19+ && ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/src/boringssl-build /libcrypto.a
20+ ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/
21+ && ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/src/boringssl/src/include /openssl
22+ ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/openssl
23+ )
24+
25+ add_library (boringssl_ssl STATIC IMPORTED GLOBAL )
26+ set_target_properties (
27+ boringssl_ssl
28+ PROPERTIES
29+ IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/libssl.a
30+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/
31+ )
32+ add_dependencies (boringssl_ssl boringssl)
33+
34+ add_library (boringssl_crypto STATIC IMPORTED GLOBAL )
35+ set_target_properties (
36+ boringssl_crypto
37+ PROPERTIES
38+ IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/libcrypto.a
39+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} /external/boringssl/
40+ )
41+ add_dependencies (boringssl_crypto boringssl)
0 commit comments