[Openvpn-devel,v6] Fix building wolfSSL with CMake

Message ID 20260628150320.13244-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v6] Fix building wolfSSL with CMake |

Commit Message

Gert Doering June 28, 2026, 3:03 p.m. UTC
  From: Arne Schwabe <arne@rfc2549.org>

Change-Id: I355760e43c3e2da0dda0cdec6e4253c028cefe38
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1604
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1604
This mail reflects revision 6 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>
  

Comments

Gert Doering June 28, 2026, 8:33 p.m. UTC | #1
CMake build system only, ACK from Frank, buildbot is happy with it
(= it does not break anything - we do not have WolfSSL buildbots
today to actually test this).

Your patch has been applied to the master branch.

commit 9e2f3843df1cdacffb20f7ca4e6aba6a784acb05
Author: Arne Schwabe
Date:   Sun Jun 28 17:03:15 2026 +0200

     Fix building wolfSSL with CMake

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1604
     Message-Id: <20260628150320.13244-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37342.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 715d02c..4779d69 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -327,6 +327,7 @@ 
     elseif (${WOLFSSL})
         pkg_search_module(wolfssl wolfssl REQUIRED)
         target_link_libraries(${target} PUBLIC ${wolfssl_LINK_LIBRARIES})
+        target_include_directories(${target} PRIVATE ${wolfssl_INCLUDE_DIRS})
         target_include_directories(${target} PRIVATE ${wolfssl_INCLUDE_DIRS}/wolfssl)
     else ()
         find_package(OpenSSL REQUIRED)
@@ -367,6 +368,7 @@ 
 elseif (${WOLFSSL})
     set(ENABLE_CRYPTO_OPENSSL YES)
     set(ENABLE_CRYPTO_WOLFSSL YES)
+    set(EXTERNAL_OPTS_OPENVPN YES)
 else ()
     set(ENABLE_CRYPTO_OPENSSL YES)
 endif ()
diff --git a/config.h.cmake.in b/config.h.cmake.in
index ae1d264..34f289d 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -13,6 +13,7 @@ 
 
 /* Use wolfSSL crypto library */
 #cmakedefine ENABLE_CRYPTO_WOLFSSL
+#cmakedefine EXTERNAL_OPTS_OPENVPN
 
 /* Enable shared data channel offload */
 #cmakedefine ENABLE_DCO