From: "plaisthos (Code Review)" Date: Mon, 20 Nov 2023 10:23:37 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., max@...2606... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="SM1+D+TrEJA="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Allow specifying custom mbed TLS directories with CMake List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel , MaxF --SM1+D+TrEJA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello flichtenheld, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/377?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+1 by flichtenheld Change subject: Allow specifying custom mbed TLS directories with CMake ...................................................................... Allow specifying custom mbed TLS directories with CMake When installing mbed TLS 2.x and 3.x in parallel, it is useful to point cmake to the version that should be used. Change-Id: I7fd9e730e87210d2b7d090c8f9c7c6734bd7374e --- M CMakeLists.txt 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/77/377/2 diff --git a/CMakeLists.txt b/CMakeLists.txt index d21c9bd..fe9b596 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ endif () option(MBED "BUILD with mbed" OFF) +set(MBED_INCLUDE_PATH "" CACHE STRING "Path to mbed TLS include directory") +set(MBED_LIBRARY_PATH "" CACHE STRING "Path to mbed library directory") option(WOLFSSL "BUILD with wolfSSL" OFF) option(ENABLE_LZ4 "BUILD with lz4" ON) option(ENABLE_LZO "BUILD with lzo" ON) @@ -233,7 +235,14 @@ function(add_library_deps target) if (${MBED}) - target_link_libraries(${target} -lmbedtls -lmbedx509 -lmbedcrypto) + if (NOT (MBED_INCLUDE_PATH STREQUAL "") ) + target_include_directories(${target} PRIVATE ${MBED_INCLUDE_PA= TH}) + endif () + if(NOT (MBED_LIBRARY_PATH STREQUAL "")) + target_link_directories(${target} PRIVATE ${MBED_LIBRARY_PATH}) + endif () + + target_link_libraries(${target} PRIVATE -lmbedtls -lmbedx509 -lmbe= dcrypto) elseif (${WOLFSSL}) pkg_search_module(wolfssl wolfssl REQUIRED) target_link_libraries(${target} PUBLIC ${wolfssl_LINK_LIBRARIES}) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/377?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I7fd9e730e87210d2b7d090c8f9c7c6734bd7374e Gerrit-Change-Number: 377 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: MaxF Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --SM1+D+TrEJA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

plaisthos uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/377?usp=3Demail">View Chang= e

The following approvals got outdated and were removed: Code-Review+1 by flichtenheld

Allow specifying custom mbed TLS directories =
with CMake

When installing mbed TLS 2.x and 3.x in parallel, it is u= seful to point
cmake to the version that should be used.

Change-I= d: I7fd9e730e87210d2b7d090c8f9c7c6734bd7374e
---
M CMakeLists.txt
= 1 file changed, 10 insertions(+), 1 deletion(-)

git pull ssh://ge=
rrit.openvpn.net:29418/openvpn refs/changes/77/377/2
diff --git a/C=
MakeLists.txt b/CMakeLists.txt
index d21c9bd..fe9b596 10064= 4
--- a/CMakeLists.txt
+++ b/CMakeLists.txt=
@@ -32,6 +32,8 @@
endif ()

option(MBED "BUILD with mbed" OFF)+set(MBED_INCLUDE_PATH "&= quot; CACHE STRING "Path to mbed TLS include directory")+set(MBED_LIBRARY_PATH "= " CACHE STRING "Path to mbed library directory")
<= span> option(WOLFSSL "BUILD with wolfSSL" OFF)
o= ption(ENABLE_LZ4 "BUILD with lz4" ON)
option(ENA= BLE_LZO "BUILD with lzo" ON)
@@ -233,7 +235,14 @@=

function(add_library_deps target)
if (${MBED})
- target_link_libraries(${target} -lmbedtls -lmbedx509 -lmbedc= rypto)
+ if (N= OT (MBED_INCLUDE_PATH STREQUAL "") )
+ target_include_directories(${target}= PRIVATE ${MBED_INCLUDE_PATH})
+ endif ()
+ if(NOT (MBED_LIBRARY_PATH STREQUAL ""))+ target_link_direc= tories(${target} PRIVATE ${MBED_LIBRARY_PATH})
+ endif ()
+
+ target_link_libraries(${target} PRIVATE -lmbedtls -lmb= edx509 -lmbedcrypto)
elseif (${WOLFSSL})
pkg_search_module(wolfssl wolfssl REQUIRED)

= target_link_libraries(${target} PUBLIC ${wolfssl_LINK_LIBRARIES})

To view, visit change 377. To unsubscribe, or f= or help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7fd9e730e87210d2b7d090c8f9c= 7c6734bd7374e
Gerrit-Change-Number: 377
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: MaxF <max@...2606...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--SM1+D+TrEJA=--