Skip to content

Commit 7c39b60

Browse files
Improve sections "Using Mbed TLS as a CMake subproject/package"
Signed-off-by: Ronald Cron <[email protected]>
1 parent dca3b38 commit 7c39b60

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,35 @@ You may need to update include paths to the public header files, see [File and D
116116

117117
#### Using Mbed TLS as a CMake subproject
118118

119-
The base name of the CMake cryptography library target has been changed from `mbedcrypto` to `tfpsacrypto`.
120-
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+
The base name of the libraries are now `tfpsacrypto` (formely `mbedcrypto`), `mbedx509` and `mbedtls`.
120+
As before, these base names are also the names of CMake targets to build each library.
121+
If your CMake scripts reference a cryptography library target, you need to update its name accordingly.
122+
123+
For example, the following CMake code:
124+
```
125+
target_link_libraries(mytarget PRIVATE mbedcrypto)
126+
```
127+
should be updated to:
128+
```
129+
target_link_libraries(mytarget PRIVATE tfpsacrypto)
130+
```
121131

122132
You can refer to the following example demonstrating how to consume Mbed TLS as a CMake subproject:
123133
- `programs/test/cmake_subproject`
124134

125135
#### Using Mbed TLS as a CMake package
126136

127-
The same renaming applies to the cryptography library targets declared as part of the Mbed TLS CMake package.
128-
When no global target prefix is defined, use `MbedTLS::tfpsacrypto` instead of `MbedTLS::mbedcrypto`.
137+
The same renaming applies to the cryptography library targets declared as part of the Mbed TLS CMake package, use `MbedTLS::tfpsacrypto` instead of `MbedTLS::mbedcrypto`.
129138

130139
For example, the following CMake code:
131140
```
132141
find_package(MbedTLS REQUIRED)
133-
target_link_libraries(myapp PRIVATE MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::mbedcrypto)
142+
target_link_libraries(myapp PRIVATE MbedTLS::mbedcrypto)
134143
```
135144
should be updated to:
136145
```
137146
find_package(MbedTLS REQUIRED)
138-
target_link_libraries(myapp PRIVATE MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::tfpsacrypto)
147+
target_link_libraries(myapp PRIVATE MbedTLS::tfpsacrypto)
139148
```
140149
You can also refer to the following example programs demonstrating how to consume Mbed TLS as a CMake package:
141150
- `programs/test/cmake_package`

0 commit comments

Comments
 (0)