master
1#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9#
10# This software is licensed as described in the file COPYING, which
11# you should have received as part of this distribution. The terms
12# are also available at https://curl.se/docs/copyright.html.
13#
14# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15# copies of the Software, and permit persons to whom the Software is
16# furnished to do so, under the terms of the COPYING file.
17#
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
20#
21# SPDX-License-Identifier: curl
22#
23###########################################################################
24# Find the mbedTLS library
25#
26# Input variables:
27#
28# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory.
29# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library.
30# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library.
31# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library.
32# - `MBEDTLS_USE_STATIC_LIBS`: Configure for static mbedTLS libraries.
33#
34# Defines:
35#
36# - `MBEDTLS_FOUND`: System has mbedTLS.
37# - `MBEDTLS_VERSION`: Version of mbedTLS.
38# - `CURL::mbedtls`: mbedTLS library target.
40set(_mbedtls_pc_requires "mbedtls" "mbedx509" "mbedcrypto")
42if(NOT DEFINED MBEDTLS_INCLUDE_DIR AND
43 NOT DEFINED MBEDTLS_LIBRARY AND
44 NOT DEFINED MBEDX509_LIBRARY AND
45 NOT DEFINED MBEDCRYPTO_LIBRARY)
46 if(CURL_USE_PKGCONFIG)
47 find_package(PkgConfig QUIET)
48 pkg_check_modules(_mbedtls ${_mbedtls_pc_requires})
49 endif()
50 if(NOT _mbedtls_FOUND AND CURL_USE_CMAKECONFIG)
51 find_package(MbedTLS CONFIG QUIET)
52 endif()
53endif()
55if(_mbedtls_FOUND)
56 set(MbedTLS_FOUND TRUE)
57 set(MBEDTLS_FOUND TRUE)
58 set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION})
59 if(MBEDTLS_USE_STATIC_LIBS)
60 set(_mbedtls_CFLAGS "${_mbedtls_STATIC_CFLAGS}")
61 set(_mbedtls_INCLUDE_DIRS "${_mbedtls_STATIC_INCLUDE_DIRS}")
62 set(_mbedtls_LIBRARY_DIRS "${_mbedtls_STATIC_LIBRARY_DIRS}")
63 set(_mbedtls_LIBRARIES "${_mbedtls_STATIC_LIBRARIES}")
64 endif()
65 message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
66elseif(MbedTLS_CONFIG)
67 set(MbedTLS_FOUND TRUE)
68 set(MBEDTLS_FOUND TRUE)
69 set(MBEDTLS_VERSION ${MbedTLS_VERSION})
70 if(MBEDTLS_VERSION GREATER_EQUAL 4.0.0)
71 set(_mbedtls_LIBRARIES MbedTLS::tfpsacrypto)
72 else()
73 set(_mbedtls_LIBRARIES MbedTLS::mbedcrypto)
74 endif()
75 list(APPEND _mbedtls_LIBRARIES MbedTLS::mbedx509 MbedTLS::mbedtls)
76 message(STATUS "Found MbedTLS (via CMake Config): ${MbedTLS_CONFIG} (found version \"${MBEDTLS_VERSION}\")")
77else()
78 set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config
80 find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h")
81 if(MBEDTLS_USE_STATIC_LIBS)
82 find_library(MBEDTLS_LIBRARY NAMES "mbedtls_static" "libmbedtls_static" "mbedtls" "libmbedtls")
83 find_library(MBEDX509_LIBRARY NAMES "mbedx509_static" "libmbedx509_static" "mbedx509" "libmbedx509")
84 find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto_static" "libmbedcrypto_static" "mbedcrypto" "libmbedcrypto"
85 "tfpsacrypto_static" "libtfpsacrypto_static" "tfpsacrypto" "libtfpsacrypto")
86 else()
87 find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
88 find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
89 find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto" "tfpsacrypto" "libtfpsacrypto")
90 endif()
92 unset(MBEDTLS_VERSION CACHE)
93 if(MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
94 set(_version_regex "#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([0-9.]+)\"")
95 file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h" _version_str REGEX "${_version_regex}")
96 string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
97 set(MBEDTLS_VERSION "${_version_str}")
98 unset(_version_regex)
99 unset(_version_str)
100 endif()
102 include(FindPackageHandleStandardArgs)
103 find_package_handle_standard_args(MbedTLS
104 REQUIRED_VARS
105 MBEDTLS_INCLUDE_DIR
106 MBEDTLS_LIBRARY
107 MBEDX509_LIBRARY
108 MBEDCRYPTO_LIBRARY
109 VERSION_VAR
110 MBEDTLS_VERSION
111 )
113 if(MBEDTLS_FOUND)
114 set(_mbedtls_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
115 set(_mbedtls_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
116 endif()
118 mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
119endif()
121if(MBEDTLS_FOUND)
122 if(NOT TARGET CURL::mbedtls)
123 add_library(CURL::mbedtls INTERFACE IMPORTED)
124 set_target_properties(CURL::mbedtls PROPERTIES
125 INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}"
126 INTERFACE_COMPILE_OPTIONS "${_mbedtls_CFLAGS}"
127 INTERFACE_INCLUDE_DIRECTORIES "${_mbedtls_INCLUDE_DIRS}"
128 INTERFACE_LINK_DIRECTORIES "${_mbedtls_LIBRARY_DIRS}"
129 INTERFACE_LINK_LIBRARIES "${_mbedtls_LIBRARIES}")
130 endif()
131endif()
Diagnostics4 git calls · 29 ms
CallStatusSizeTime029 ms
discover200152 B2 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=149 git.response.cache=HIT git.response.duration_ms=2 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=149 git.pkt.payload.max=78 git.ls_refs.count=2 git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=10 git.pkt.data=8 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=293470 git.pkt.payload.max=65516 git.sideband.band1.bytes=293354 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=87 git.pack.bytes=293354 git.pack.ofs_delta=0 git.pack.ref_delta=1 git.pack.chain.max=1 git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0 git.pack.full=86Open pack map
fetch2001.8 KiB · hit24 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=24 git.response.bytes=1849 git.response.cache=HIT git.response.duration_ms=24 git.fetch.wants=804596a261e117e6408642da4ffca1c332b89baa git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=1849 git.pkt.payload.max=1828 git.sideband.band1.bytes=1827 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
- Ref
- refs/heads/master
- Commit
- 31c911efe5652725e930f4d2e60c9060e5f6646d
- cf-ray
- a5e2d923c92714c2
- Request
- a3a0fa5a…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format