Manuel Pégourié-Gonnard | 463e09d | 2015-06-24 11:54:19 +0200 | [diff] [blame] | 1 | set(src_x509 |
Harry Ramsey | 798d8b6 | 2024-10-11 17:09:18 +0100 | [diff] [blame] | 2 | error.c |
Daniel Axtens | aa91d4e | 2020-05-29 00:23:21 +1000 | [diff] [blame] | 3 | pkcs7.c |
Manuel Pégourié-Gonnard | 463e09d | 2015-06-24 11:54:19 +0200 | [diff] [blame] | 4 | x509.c |
| 5 | x509_create.c |
| 6 | x509_crl.c |
| 7 | x509_crt.c |
| 8 | x509_csr.c |
Andrzej Kurek | c508dc2 | 2023-07-07 08:20:02 -0400 | [diff] [blame] | 9 | x509write.c |
Manuel Pégourié-Gonnard | 463e09d | 2015-06-24 11:54:19 +0200 | [diff] [blame] | 10 | x509write_crt.c |
| 11 | x509write_csr.c |
| 12 | ) |
| 13 | |
| 14 | set(src_tls |
| 15 | debug.c |
Gilles Peskine | 89e31ad | 2022-11-26 14:18:45 +0100 | [diff] [blame] | 16 | mps_reader.c |
| 17 | mps_trace.c |
Andres AG | 788aa4a | 2016-09-14 14:32:09 +0100 | [diff] [blame] | 18 | net_sockets.c |
Manuel Pégourié-Gonnard | 463e09d | 2015-06-24 11:54:19 +0200 | [diff] [blame] | 19 | ssl_cache.c |
| 20 | ssl_ciphersuites.c |
Ronald Cron | 3d580bf | 2022-02-18 17:24:56 +0100 | [diff] [blame] | 21 | ssl_client.c |
Manuel Pégourié-Gonnard | 463e09d | 2015-06-24 11:54:19 +0200 | [diff] [blame] | 22 | ssl_cookie.c |
Gilles Peskine | 898db6b | 2022-11-26 14:15:32 +0100 | [diff] [blame] | 23 | ssl_debug_helpers_generated.c |
Hanno Becker | 6e7051a | 2020-02-05 11:33:54 +0000 | [diff] [blame] | 24 | ssl_msg.c |
Manuel Pégourié-Gonnard | 463e09d | 2015-06-24 11:54:19 +0200 | [diff] [blame] | 25 | ssl_ticket.c |
Hanno Becker | 471c0c9 | 2020-02-05 11:32:03 +0000 | [diff] [blame] | 26 | ssl_tls.c |
Ronald Cron | de1adee | 2022-03-07 16:20:30 +0100 | [diff] [blame] | 27 | ssl_tls12_client.c |
| 28 | ssl_tls12_server.c |
Hanno Becker | be9d664 | 2020-08-21 13:20:06 +0100 | [diff] [blame] | 29 | ssl_tls13_keys.c |
Jerry Yu | 3cc4c2a | 2021-08-06 16:29:08 +0800 | [diff] [blame] | 30 | ssl_tls13_server.c |
| 31 | ssl_tls13_client.c |
Jerry Yu | 65dd2cc | 2021-08-18 16:38:40 +0800 | [diff] [blame] | 32 | ssl_tls13_generic.c |
Harry Ramsey | 468c0ae | 2024-09-27 14:38:53 +0100 | [diff] [blame] | 33 | version.c |
| 34 | version_features.c |
Manuel Pégourié-Gonnard | 463e09d | 2015-06-24 11:54:19 +0200 | [diff] [blame] | 35 | ) |
| 36 | |
David Horstmann | a8d1406 | 2021-10-20 17:14:23 +0100 | [diff] [blame] | 37 | if(GEN_FILES) |
Harry Ramsey | 798d8b6 | 2024-10-11 17:09:18 +0100 | [diff] [blame] | 38 | find_package(Perl REQUIRED) |
| 39 | |
| 40 | file(GLOB crypto_error_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/*.h) |
| 41 | file(GLOB tls_error_headers ${MBEDTLS_DIR}/include/mbedtls/*.h) |
| 42 | add_custom_command( |
| 43 | OUTPUT |
| 44 | ${CMAKE_CURRENT_BINARY_DIR}/error.c |
| 45 | COMMAND |
| 46 | ${PERL_EXECUTABLE} |
| 47 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_errors.pl |
| 48 | ${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/drivers/builtin/include/mbedtls |
| 49 | ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls |
| 50 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files |
| 51 | ${CMAKE_CURRENT_BINARY_DIR}/${TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_DIR}/error.c |
| 52 | DEPENDS |
| 53 | ${MBEDTLS_DIR}/scripts/generate_errors.pl |
| 54 | ${crypto_error_headers} |
| 55 | ${tls_error_headers} |
| 56 | ${MBEDTLS_DIR}/scripts/data_files/error.fmt |
| 57 | ) |
Jerry Yu | eb96fb5 | 2021-12-02 11:03:59 +0800 | [diff] [blame] | 58 | add_custom_command( |
| 59 | OUTPUT |
Harry Ramsey | 468c0ae | 2024-09-27 14:38:53 +0100 | [diff] [blame] | 60 | ${CMAKE_CURRENT_BINARY_DIR}/version_features.c |
| 61 | COMMAND |
| 62 | ${PERL_EXECUTABLE} |
| 63 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_features.pl |
| 64 | ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls |
| 65 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files |
| 66 | ${CMAKE_CURRENT_BINARY_DIR}/version_features.c |
| 67 | DEPENDS |
| 68 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/generate_features.pl |
| 69 | ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/mbedtls_config.h |
| 70 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data_files/version_features.fmt |
| 71 | ) |
| 72 | |
| 73 | add_custom_command( |
| 74 | OUTPUT |
Jerry Yu | eb96fb5 | 2021-12-02 11:03:59 +0800 | [diff] [blame] | 75 | ${CMAKE_CURRENT_BINARY_DIR}/ssl_debug_helpers_generated.c |
| 76 | COMMAND |
| 77 | ${MBEDTLS_PYTHON_EXECUTABLE} |
Elena Uziunaite | 09fee36 | 2024-10-07 17:40:21 +0100 | [diff] [blame] | 78 | ${CMAKE_CURRENT_SOURCE_DIR}/../framework/scripts/generate_ssl_debug_helpers.py |
Jerry Yu | e6369b0 | 2021-12-02 13:51:26 +0800 | [diff] [blame] | 79 | --mbedtls-root ${CMAKE_CURRENT_SOURCE_DIR}/.. |
| 80 | ${CMAKE_CURRENT_BINARY_DIR} |
Jerry Yu | eb96fb5 | 2021-12-02 11:03:59 +0800 | [diff] [blame] | 81 | DEPENDS |
Elena Uziunaite | 09fee36 | 2024-10-07 17:40:21 +0100 | [diff] [blame] | 82 | ${CMAKE_CURRENT_SOURCE_DIR}/../framework/scripts/generate_ssl_debug_helpers.py |
Ronald Cron | 3d817ad | 2024-06-14 08:43:28 +0200 | [diff] [blame] | 83 | ${tls_error_headers} |
Jerry Yu | eb96fb5 | 2021-12-02 11:03:59 +0800 | [diff] [blame] | 84 | ) |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 85 | else() |
Harry Ramsey | 798d8b6 | 2024-10-11 17:09:18 +0100 | [diff] [blame] | 86 | link_to_source(error.c) |
Harry Ramsey | 468c0ae | 2024-09-27 14:38:53 +0100 | [diff] [blame] | 87 | link_to_source(version_features.c) |
Jerry Yu | eb96fb5 | 2021-12-02 11:03:59 +0800 | [diff] [blame] | 88 | link_to_source(ssl_debug_helpers_generated.c) |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 89 | endif() |
Manuel Pégourié-Gonnard | 65a7203 | 2021-05-11 13:02:44 +0200 | [diff] [blame] | 90 | |
Paul Bakker | 76f0311 | 2013-11-28 17:20:04 +0100 | [diff] [blame] | 91 | if(CMAKE_COMPILER_IS_GNUCC) |
Ronald Cron | 50bd4f8 | 2024-10-10 12:17:59 +0200 | [diff] [blame] | 92 | set(LIBS_C_FLAGS -Wmissing-declarations) |
Paul Bakker | 76f0311 | 2013-11-28 17:20:04 +0100 | [diff] [blame] | 93 | endif(CMAKE_COMPILER_IS_GNUCC) |
| 94 | |
Manuel Pégourié-Gonnard | 3185545 | 2014-06-25 15:59:50 +0200 | [diff] [blame] | 95 | if(CMAKE_COMPILER_IS_CLANG) |
Ronald Cron | 50bd4f8 | 2024-10-10 12:17:59 +0200 | [diff] [blame] | 96 | set(LIBS_C_FLAGS -Wmissing-declarations -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code) |
Manuel Pégourié-Gonnard | 3185545 | 2014-06-25 15:59:50 +0200 | [diff] [blame] | 97 | endif(CMAKE_COMPILER_IS_CLANG) |
| 98 | |
Krzysztof Stachowiak | de6effa | 2018-10-31 12:46:37 +0100 | [diff] [blame] | 99 | if(CMAKE_COMPILER_IS_MSVC) |
| 100 | option(MSVC_STATIC_RUNTIME "Build the libraries with /MT compiler flag" OFF) |
| 101 | if(MSVC_STATIC_RUNTIME) |
| 102 | foreach(flag_var |
| 103 | CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE |
| 104 | CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO |
| 105 | CMAKE_C_FLAGS_CHECK) |
| 106 | string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") |
| 107 | endforeach(flag_var) |
| 108 | endif() |
| 109 | endif() |
| 110 | |
Signed-off-by: Steven WdV | bcfed50 | 2024-02-29 15:12:36 +0100 | [diff] [blame] | 111 | if(CMAKE_C_COMPILER_ID MATCHES "AppleClang") |
| 112 | set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>") |
Signed-off-by: Steven WdV | bcfed50 | 2024-02-29 15:12:36 +0100 | [diff] [blame] | 113 | set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>") |
Steven WdV | 9f0858d | 2024-03-19 11:39:22 +0100 | [diff] [blame] | 114 | endif() |
| 115 | if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") |
| 116 | set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>") |
Signed-off-by: Steven WdV | bcfed50 | 2024-02-29 15:12:36 +0100 | [diff] [blame] | 117 | set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>") |
Andres Amaya Garcia | bf7fe4f | 2018-06-21 20:21:38 +0100 | [diff] [blame] | 118 | endif() |
TabascoEye | 7f3ef27 | 2018-04-27 13:14:59 +0200 | [diff] [blame] | 119 | |
Augustin Cavalier | 60bc47d | 2018-04-11 20:27:32 -0400 | [diff] [blame] | 120 | if(HAIKU) |
Simon Butcher | 6331cb0 | 2018-07-10 11:48:42 +0100 | [diff] [blame] | 121 | set(libs ${libs} network) |
Augustin Cavalier | 60bc47d | 2018-04-11 20:27:32 -0400 | [diff] [blame] | 122 | endif(HAIKU) |
| 123 | |
Manuel Pégourié-Gonnard | ba2c876 | 2015-06-25 09:35:46 +0200 | [diff] [blame] | 124 | if(LINK_WITH_PTHREAD) |
Paul Elliott | 7fd162e | 2024-01-24 18:05:53 +0000 | [diff] [blame] | 125 | set(libs ${libs} ${CMAKE_THREAD_LIBS_INIT}) |
Manuel Pégourié-Gonnard | ba2c876 | 2015-06-25 09:35:46 +0200 | [diff] [blame] | 126 | endif() |
| 127 | |
Manuel Pégourié-Gonnard | 9014b6f | 2015-01-27 15:44:46 +0000 | [diff] [blame] | 128 | if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 129 | message(FATAL_ERROR "Need to choose static or shared mbedtls build!") |
Manuel Pégourié-Gonnard | 9014b6f | 2015-01-27 15:44:46 +0000 | [diff] [blame] | 130 | endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) |
Paul Bakker | 9d3a7e4 | 2011-01-05 15:24:43 +0000 | [diff] [blame] | 131 | |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 132 | set(mbedtls_target "${MBEDTLS_TARGET_PREFIX}mbedtls") |
| 133 | set(mbedx509_target "${MBEDTLS_TARGET_PREFIX}mbedx509") |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 134 | |
| 135 | set(mbedtls_target ${mbedtls_target} PARENT_SCOPE) |
| 136 | set(mbedx509_target ${mbedx509_target} PARENT_SCOPE) |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 137 | |
| 138 | if (USE_STATIC_MBEDTLS_LIBRARY) |
Ronald Cron | f8a3f28 | 2024-07-24 08:42:32 +0200 | [diff] [blame] | 139 | set(mbedtls_static_target ${mbedtls_target}) |
| 140 | set(mbedx509_static_target ${mbedx509_target}) |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 141 | endif() |
| 142 | |
Ronald Cron | e82ad15 | 2024-07-19 12:01:43 +0200 | [diff] [blame] | 143 | set(target_libraries ${mbedx509_target} ${mbedtls_target}) |
Gilles Peskine | 3ca8a92 | 2020-07-02 13:07:37 +0200 | [diff] [blame] | 144 | |
Manuel Pégourié-Gonnard | 9014b6f | 2015-01-27 15:44:46 +0000 | [diff] [blame] | 145 | if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY) |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 146 | string(APPEND mbedtls_static_target "_static") |
| 147 | string(APPEND mbedx509_static_target "_static") |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 148 | |
Gilles Peskine | 3ca8a92 | 2020-07-02 13:07:37 +0200 | [diff] [blame] | 149 | list(APPEND target_libraries |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 150 | ${mbedx509_static_target} |
| 151 | ${mbedtls_static_target}) |
hasufell | 3c6409b | 2014-03-06 15:49:08 +0100 | [diff] [blame] | 152 | endif() |
Paul Bakker | 9d3a7e4 | 2011-01-05 15:24:43 +0000 | [diff] [blame] | 153 | |
Manuel Pégourié-Gonnard | 9014b6f | 2015-01-27 15:44:46 +0000 | [diff] [blame] | 154 | if(USE_STATIC_MBEDTLS_LIBRARY) |
Gilles Peskine | 55d5353 | 2020-03-09 17:48:13 +0100 | [diff] [blame] | 155 | add_library(${mbedx509_static_target} STATIC ${src_x509}) |
Ronald Cron | b247898 | 2024-10-07 16:17:07 +0200 | [diff] [blame] | 156 | set_base_compile_options(${mbedx509_static_target}) |
Ronald Cron | 50bd4f8 | 2024-10-10 12:17:59 +0200 | [diff] [blame] | 157 | target_compile_options(${mbedx509_static_target} PRIVATE ${LIBS_C_FLAGS}) |
Gilles Peskine | 55d5353 | 2020-03-09 17:48:13 +0100 | [diff] [blame] | 158 | set_target_properties(${mbedx509_static_target} PROPERTIES OUTPUT_NAME mbedx509) |
Ronald Cron | b7d0e52 | 2024-10-25 16:01:14 +0200 | [diff] [blame^] | 159 | target_link_libraries(${mbedx509_static_target} PUBLIC ${libs} ${tfpsacrypto_static_target}) |
Manuel Pégourié-Gonnard | c7781ad | 2015-06-25 09:49:02 +0200 | [diff] [blame] | 160 | |
Gilles Peskine | 55d5353 | 2020-03-09 17:48:13 +0100 | [diff] [blame] | 161 | add_library(${mbedtls_static_target} STATIC ${src_tls}) |
Ronald Cron | b247898 | 2024-10-07 16:17:07 +0200 | [diff] [blame] | 162 | set_base_compile_options(${mbedtls_static_target}) |
Ronald Cron | 50bd4f8 | 2024-10-10 12:17:59 +0200 | [diff] [blame] | 163 | target_compile_options(${mbedtls_static_target} PRIVATE ${LIBS_C_FLAGS}) |
Gilles Peskine | 55d5353 | 2020-03-09 17:48:13 +0100 | [diff] [blame] | 164 | set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls) |
Raef Coles | 4762edd | 2020-10-13 16:31:41 +0100 | [diff] [blame] | 165 | target_link_libraries(${mbedtls_static_target} PUBLIC ${libs} ${mbedx509_static_target}) |
Manuel Pégourié-Gonnard | e1d34d1 | 2015-06-25 14:53:13 +0200 | [diff] [blame] | 166 | endif(USE_STATIC_MBEDTLS_LIBRARY) |
Paul Bakker | 9d3a7e4 | 2011-01-05 15:24:43 +0000 | [diff] [blame] | 167 | |
Manuel Pégourié-Gonnard | 9014b6f | 2015-01-27 15:44:46 +0000 | [diff] [blame] | 168 | if(USE_SHARED_MBEDTLS_LIBRARY) |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 169 | add_library(${mbedx509_target} SHARED ${src_x509}) |
Ronald Cron | b247898 | 2024-10-07 16:17:07 +0200 | [diff] [blame] | 170 | set_base_compile_options(${mbedx509_target}) |
Ronald Cron | 50bd4f8 | 2024-10-10 12:17:59 +0200 | [diff] [blame] | 171 | target_compile_options(${mbedx509_target} PRIVATE ${LIBS_C_FLAGS}) |
David Horstmann | 7ba04a2 | 2024-09-03 17:36:30 +0100 | [diff] [blame] | 172 | set_target_properties(${mbedx509_target} PROPERTIES VERSION 4.0.0 SOVERSION 7) |
Ronald Cron | b7d0e52 | 2024-10-25 16:01:14 +0200 | [diff] [blame^] | 173 | target_link_libraries(${mbedx509_target} PUBLIC ${libs} ${tfpsacrypto_target}) |
Manuel Pégourié-Gonnard | c7781ad | 2015-06-25 09:49:02 +0200 | [diff] [blame] | 174 | |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 175 | add_library(${mbedtls_target} SHARED ${src_tls}) |
Ronald Cron | b247898 | 2024-10-07 16:17:07 +0200 | [diff] [blame] | 176 | set_base_compile_options(${mbedtls_target}) |
Ronald Cron | 50bd4f8 | 2024-10-10 12:17:59 +0200 | [diff] [blame] | 177 | target_compile_options(${mbedtls_target} PRIVATE ${LIBS_C_FLAGS}) |
David Horstmann | 7ba04a2 | 2024-09-03 17:36:30 +0100 | [diff] [blame] | 178 | set_target_properties(${mbedtls_target} PROPERTIES VERSION 4.0.0 SOVERSION 21) |
Raef Coles | 4762edd | 2020-10-13 16:31:41 +0100 | [diff] [blame] | 179 | target_link_libraries(${mbedtls_target} PUBLIC ${libs} ${mbedx509_target}) |
Manuel Pégourié-Gonnard | 9014b6f | 2015-01-27 15:44:46 +0000 | [diff] [blame] | 180 | endif(USE_SHARED_MBEDTLS_LIBRARY) |
Manuel Pégourié-Gonnard | e1d34d1 | 2015-06-25 14:53:13 +0200 | [diff] [blame] | 181 | |
Gilles Peskine | 3ca8a92 | 2020-07-02 13:07:37 +0200 | [diff] [blame] | 182 | foreach(target IN LISTS target_libraries) |
Robert Shade | 591e729 | 2022-05-12 14:40:16 -0400 | [diff] [blame] | 183 | add_library(MbedTLS::${target} ALIAS ${target}) # add_subdirectory support |
Ronald Cron | aef8cf3 | 2024-07-01 18:33:24 +0200 | [diff] [blame] | 184 | # Include public header files from /include, /tf-psa-crypto/include/ and |
| 185 | # tf-psa-crypto/drivers/builtin/include/. Include private header files |
| 186 | # from /library, tf-psa-crypto/core/ and tf-psa-crypto/drivers/builtin/src/. |
Gilles Peskine | 3ca8a92 | 2020-07-02 13:07:37 +0200 | [diff] [blame] | 187 | target_include_directories(${target} |
Chris Kay | d259e34 | 2021-03-25 16:03:25 +0000 | [diff] [blame] | 188 | PUBLIC $<BUILD_INTERFACE:${MBEDTLS_DIR}/include/> |
Ronald Cron | c7e9e36 | 2024-06-10 09:41:49 +0200 | [diff] [blame] | 189 | $<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/include/> |
Ronald Cron | 3d817ad | 2024-06-14 08:43:28 +0200 | [diff] [blame] | 190 | $<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/include/> |
Chris Kay | d259e34 | 2021-03-25 16:03:25 +0000 | [diff] [blame] | 191 | $<INSTALL_INTERFACE:include/> |
David Horstmann | b7b4f23 | 2023-09-27 13:57:11 +0100 | [diff] [blame] | 192 | PRIVATE ${MBEDTLS_DIR}/library/ |
Ronald Cron | c29afb6 | 2024-07-01 14:50:54 +0200 | [diff] [blame] | 193 | ${MBEDTLS_DIR}/tf-psa-crypto/core |
Ronald Cron | e82ad15 | 2024-07-19 12:01:43 +0200 | [diff] [blame] | 194 | ${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/src) |
Ronald Cron | 211bf6d | 2024-10-23 14:22:03 +0200 | [diff] [blame] | 195 | set_config_files_compile_definitions(${target}) |
Chris Kay | d259e34 | 2021-03-25 16:03:25 +0000 | [diff] [blame] | 196 | install( |
| 197 | TARGETS ${target} |
| 198 | EXPORT MbedTLSTargets |
Biswapriyo Nath | d7e0ee4 | 2022-04-22 20:59:50 +0530 | [diff] [blame] | 199 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 200 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 201 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
Chris Kay | d259e34 | 2021-03-25 16:03:25 +0000 | [diff] [blame] | 202 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) |
Gilles Peskine | 3ca8a92 | 2020-07-02 13:07:37 +0200 | [diff] [blame] | 203 | endforeach(target) |
Manuel Pégourié-Gonnard | e1d34d1 | 2015-06-25 14:53:13 +0200 | [diff] [blame] | 204 | |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 205 | set(lib_target "${MBEDTLS_TARGET_PREFIX}lib") |
| 206 | |
Ronald Cron | e82ad15 | 2024-07-19 12:01:43 +0200 | [diff] [blame] | 207 | add_custom_target(${lib_target} DEPENDS ${mbedx509_target} ${mbedtls_target}) |
Gilles Peskine | 55d5353 | 2020-03-09 17:48:13 +0100 | [diff] [blame] | 208 | if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY) |
Ronald Cron | e82ad15 | 2024-07-19 12:01:43 +0200 | [diff] [blame] | 209 | add_dependencies(${lib_target} ${mbedx509_static_target} ${mbedtls_static_target}) |
Manuel Pégourié-Gonnard | e1d34d1 | 2015-06-25 14:53:13 +0200 | [diff] [blame] | 210 | endif() |