involve_boringssl.cmake 2.0 KB

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