Skip to content

Commit 25b1a02

Browse files
Rework "Impact on some usages of the library" section
Signed-off-by: Ronald Cron <[email protected]>
1 parent 5d069c9 commit 25b1a02

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

docs/4.0-migration-guide/repo-split.md

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,38 +104,62 @@ git submodule update --init --recursive
104104
```
105105

106106
#### Linking directly to a built library
107+
107108
The Mbed TLS CMake build system still provides the cryptography libraries under their legacy name, `libmbedcrypto.<ext>`, so you can continue linking against them.
108-
The cryptography libraries are also now provided as `libtfpsacrypto.<ext>` like in the TF-PSA-Crypto repository.
109+
These libraries are still located in the `library` directory within the build tree.
110+
111+
The cryptography libraries are also now provided as `libtfpsacrypto.<ext>`, consistent with the naming used in the TF-PSA-Crypto repository.
112+
113+
You may need to update include paths to the public header files, see [File and Directory Relocations](#file-and-directory-relocations) for details.
114+
115+
#### Using Mbed TLS as a CMake subproject
109116

110-
#### Linking through a CMake target of the cryptography library
111117
The base name of the CMake cryptography library target has been changed from `mbedcrypto` to `tfpsacrypto`.
112-
If no target prefix is specified through the MBEDTLS_TARGET_PREFIX option, the associated CMake target is thus now `tfpsacrypto`.
118+
If no target prefix is specified through the `MBEDTLS_TARGET_PREFIX` option, the associated CMake target is now `tfpsacrypto`, and you will need to update it in your CMake scripts.
119+
120+
You can refer to the following example demonstrating how to consume Mbed TLS as a CMake subproject:
121+
- `programs/test/cmake_subproject`
122+
123+
#### Using Mbed TLS as a CMake package
113124

114125
The same renaming applies to the cryptography library targets declared as part of the Mbed TLS CMake package.
115126
When no global target prefix is defined, use `MbedTLS::tfpsacrypto` instead of `MbedTLS::mbedcrypto`.
116127

117-
As an example, the following CMake code:
128+
For example, the following CMake code:
118129
```
119130
find_package(MbedTLS REQUIRED)
120131
target_link_libraries(myapp PRIVATE MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::mbedcrypto)
121-
122132
```
123-
would be updated to something like
133+
should be updated to:
124134
```
125135
find_package(MbedTLS REQUIRED)
126136
target_link_libraries(myapp PRIVATE MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::tfpsacrypto)
127137
```
138+
You can also refer to the following example programs demonstrating how to consume Mbed TLS as a CMake package:
139+
- programs/test/cmake_package
140+
- programs/test/cmake_package_install
141+
142+
#### Using the Mbed TLS Crypto pkg-config file
143+
144+
The Mbed TLS CMake build system still provides the pkg-config file mbedcrypto.pc, so you can continue using it.
145+
Internally, it now references the tfpsacrypto library.
146+
147+
A new pkg-config file, tfpsacrypto.pc, is also provided.
148+
Both mbedcrypto.pc and tfpsacrypto.pc are functionally equivalent, providing the same compiler and linker flags.
149+
150+
#### Using Mbed TLS as an installed library
151+
152+
The Mbed TLS CMake build system still installs the cryptography libraries under their legacy name, `libmbedcrypto.<ext>`, so you can continue linking against them.
153+
The cryptography library is also now provided as `libtfpsacrypto.<ext>`.
154+
155+
Regarding the headers, the main change is the relocation of some headers to private directories.
156+
These headers are installed primarily to satisfy compiler dependencies.
157+
Others remain for historical reasons and may be cleaned up in later versions of the library.
128158

129-
For more information, see the CMake section of `README.md`.
130-
You can also refer to the following example programs demonstrating how to consume Mbed TLS via CMake:
131-
* `programs/test/cmake_subproject`
132-
* `programs/test/cmake_package`
133-
* `programs/test/cmake_package_install`.
159+
We strongly recommend not relying on the declarations in these headers, as they may be removed or modified without notice.
160+
See the section Private Declarations in the TF-PSA-Crypto 1.0 migration guide for more information.
134161

135-
#### Using Mbed TLS Crypto pkg-config file
136-
The Mbed TLS CMake build system still provides the pkg-config file mbedcrypto.pc, so you can continue using it. Internally, it now references the `tfpsacrypto` library.
137-
A new pkg-config file, `tfpsacrypto.pc`, is also provided.
138-
Both `mbedcrypto.pc` and `tfpsacrypto.pc` are functionally equivalent, providing the same compiler and linker flags.
162+
Finally, note the new include/tf-psa-crypto directory, which contains the TF-PSA-Crypto version and build-time configuration headers.
139163

140164
### Audience-Specific Notes
141165

0 commit comments

Comments
 (0)