Summer Qin | e8412b4 | 2020-10-15 14:20:21 +0800 | [diff] [blame] | 1 | From 4762eddfb3e17d50b471cf6dda491047cbd712d6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Raef Coles <raef.coles@arm.com> |
| 3 | Date: Tue, 13 Oct 2020 16:31:41 +0100 |
| 4 | Subject: [PATCH 2/2] Build: Use new-style syntax in link-libraries |
| 5 | |
| 6 | Migrate to new syntax where the PUBLIC attribute is explicitly defined. |
| 7 | Avoids issues caused sometimes where cmake does not allow the mixing of |
| 8 | old-style and new-style syntax |
| 9 | |
| 10 | Signed-off-by: Raef Coles <raef.coles@arm.com> |
| 11 | --- |
| 12 | library/CMakeLists.txt | 12 ++++++------ |
| 13 | 1 file changed, 6 insertions(+), 6 deletions(-) |
| 14 | |
| 15 | diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt |
| 16 | index f0315f721..89625558a 100644 |
| 17 | --- a/library/CMakeLists.txt |
| 18 | +++ b/library/CMakeLists.txt |
| 19 | @@ -180,29 +180,29 @@ endif() |
| 20 | if(USE_STATIC_MBEDTLS_LIBRARY) |
| 21 | add_library(${mbedcrypto_static_target} STATIC ${src_crypto}) |
| 22 | set_target_properties(${mbedcrypto_static_target} PROPERTIES OUTPUT_NAME mbedcrypto) |
| 23 | - target_link_libraries(${mbedcrypto_static_target} ${libs}) |
| 24 | + target_link_libraries(${mbedcrypto_static_target} PUBLIC ${libs}) |
| 25 | |
| 26 | add_library(${mbedx509_static_target} STATIC ${src_x509}) |
| 27 | set_target_properties(${mbedx509_static_target} PROPERTIES OUTPUT_NAME mbedx509) |
| 28 | - target_link_libraries(${mbedx509_static_target} ${libs} ${mbedcrypto_static_target}) |
| 29 | + target_link_libraries(${mbedx509_static_target} PUBLIC ${libs} ${mbedcrypto_static_target}) |
| 30 | |
| 31 | add_library(${mbedtls_static_target} STATIC ${src_tls}) |
| 32 | set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls) |
| 33 | - target_link_libraries(${mbedtls_static_target} ${libs} ${mbedx509_static_target}) |
| 34 | + target_link_libraries(${mbedtls_static_target} PUBLIC ${libs} ${mbedx509_static_target}) |
| 35 | endif(USE_STATIC_MBEDTLS_LIBRARY) |
| 36 | |
| 37 | if(USE_SHARED_MBEDTLS_LIBRARY) |
| 38 | add_library(${mbedcrypto_target} SHARED ${src_crypto}) |
| 39 | set_target_properties(${mbedcrypto_target} PROPERTIES VERSION 2.24.0 SOVERSION 5) |
| 40 | - target_link_libraries(${mbedcrypto_target} ${libs}) |
| 41 | + target_link_libraries(${mbedcrypto_target} PUBLIC ${libs}) |
| 42 | |
| 43 | add_library(${mbedx509_target} SHARED ${src_x509}) |
| 44 | set_target_properties(${mbedx509_target} PROPERTIES VERSION 2.24.0 SOVERSION 1) |
| 45 | - target_link_libraries(${mbedx509_target} ${libs} ${mbedcrypto_target}) |
| 46 | + target_link_libraries(${mbedx509_target} PUBLIC ${libs} ${mbedcrypto_target}) |
| 47 | |
| 48 | add_library(${mbedtls_target} SHARED ${src_tls}) |
| 49 | set_target_properties(${mbedtls_target} PROPERTIES VERSION 2.24.0 SOVERSION 13) |
| 50 | - target_link_libraries(${mbedtls_target} ${libs} ${mbedx509_target}) |
| 51 | + target_link_libraries(${mbedtls_target} PUBLIC ${libs} ${mbedx509_target}) |
| 52 | endif(USE_SHARED_MBEDTLS_LIBRARY) |
| 53 | |
| 54 | foreach(target IN LISTS target_libraries) |
| 55 | -- |
| 56 | 2.20.1 |
| 57 | |