Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94CE4C43458 for ; Mon, 13 Jul 2026 15:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Type:Cc:Reply-To:From: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:Message-ID:References:In-Reply-To:To:Date:Sender: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hjitVZKEhuCfpOIyjDLAoVHsx3CXKHVtY7KriNET4hA=; b=bjECCm3IYB6eH6bCMIhFNGP9AS 1ljjWqVU0ZE0H9x36MmNmv8GHMtD5vyxYfD6ptXr4sYjmDgSalMnaFfcpqvlpzagz5A/oC7acbNU6 t95iZateT1tVn+CHBYp+JMOm/z1HO4miQoDfgyqeOW6mjIrj2KH8ozDNeEg+wxJ26deo=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wjIzI-0007w5-9q; Mon, 13 Jul 2026 15:54:33 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wjIzH-0007vs-4t for openvpn-devel@lists.sourceforge.net; Mon, 13 Jul 2026 15:54:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:Subject:References:In-Reply-To:List-Unsubscribe:List-Id: Cc:To:Date:From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Help:List-Subscribe :List-Post:List-Owner:List-Archive; bh=GmiQw5cbIChORNQFUv/SxVefdv4giICD9w2lTTvExrg=; b=bRWSaRwf2kAu4Q9TeeQgeFLew+ mKBucmIuEgGStcmoaXve8/3sCs5qFpoNOIdct7IQa8P140qavOgn3XVmx/K1IAeKmcIZAjOvc4xI3 GQAD7Cev4p/w8ZApEP+Y9kylOVzWqbfTHCqaLgPda/+mM2UhcRBhEYI6CZcseI1nXGh0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: Subject:References:In-Reply-To:List-Unsubscribe:List-Id:Cc:To:Date:From: Sender:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=GmiQw5cbIChORNQFUv/SxVefdv4giICD9w2lTTvExrg=; b=i ZALM1RDWRsrVD8NENECKVkcTz2VSVfHqnpF3cEtOM0qnCg6+iB35Bxd5puLYYZvQzSUybfp39M/Be lFPjvZCKV15HC05g29ATzuzL7Ks143EIJvZuuDyLCAbCViDHz4+6oPFgMLhJnmWidV7LVa/2AVic/ F7V9Zyhrpg399QnE=; Received: from mail-wm1-f54.google.com ([209.85.128.54]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1wjIzH-0004HN-2S for openvpn-devel@lists.sourceforge.net; Mon, 13 Jul 2026 15:54:31 +0000 Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-493bb510ce4so23689715e9.1 for ; Mon, 13 Jul 2026 08:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1783958064; x=1784562864; darn=lists.sourceforge.net; h=content-type:user-agent:content-disposition :content-transfer-encoding:mime-version:message-id:reply-to:subject :thread-index:references:in-reply-to:list-unsubscribe:list-id :auto-submitted:cc:to:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=GmiQw5cbIChORNQFUv/SxVefdv4giICD9w2lTTvExrg=; b=SESFom8HcE3NmQnKSJ/59Hr7DsUtCXHPSk3t225TGVNPyVNeymyGGHKcyz1x1RuJau rwobKOQaG3l7OCvxVNX/7hDuvuHShP+4AnukMO7+jA5qouSlI7E8R6rj2ecgZjw+7uic Neuc/Bz5oz4olC/7I7kSdoiyUvRSHAOd4Iw7QzyV3vzhL1Tr3xmP3ykCkYX7gNtVpUJA v6kDNa6blgpsPQszmctIgCMdpA/pRZhJkAUwdp+PvkGMx6Eu+zJJyKBH7AovEcGPjAbc 3rCKnSefqOOgLtDSmc9hXY3hrII3naghQysd7AuMFxI/C8LSQYVWbjq1T3bh746so/B+ jqsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783958064; x=1784562864; h=content-type:user-agent:content-disposition :content-transfer-encoding:mime-version:message-id:reply-to:subject :thread-index:references:in-reply-to:list-unsubscribe:list-id :auto-submitted:cc:to:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=GmiQw5cbIChORNQFUv/SxVefdv4giICD9w2lTTvExrg=; b=cbP1VkngzTf7m3hLXTkErtNIF9d8KmA4g0M8C/KONL8h+b8rO8yhjmRx9aUB22QSL6 xe/+f3Q99r/7IefcGC43mn8v69PtOxTxBSi1l1BlitiWdwDF71EKYWyegdHw0/tOWDKZ SmFkq4IcOZc+HkEOt8XbwgzMHWJtmVrgMYsZ4OTonPK14K0xQ1ev7U07hExDTLnz8y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/zn0dJVjwVu 7/I= X-Received: by 2002:a05:600c:608f:b0:493:c634:952 with SMTP id 5b1f17b1804b1-493f87d5d28mr103738825e9.7.1783958064336; Mon, 13 Jul 2026 08:54:24 -0700 (PDT) Received: from ip-10-18-1-162.eu-central-1.compute.internal (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a2f635dsm4457895e9.12.2026.07.13.08.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 08:54:23 -0700 (PDT) X-Google-Original-From: "cron2 (Code Review)" Date: Mon, 13 Jul 2026 15:54:23 +0000 To: stipa Auto-Submitted: auto-generated X-Gerrit-MessageType: merged X-Gerrit-PatchSet: 2 X-Gerrit-Change-Id: Icc14b286f2409738c73873aa7550dcc005ee8cbb X-Gerrit-Change-Number: 1739 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 2c2fec4a965cf046b3d71b3250f8d84f6af81b89 In-Reply-To: References: Thread-Index: PGdlcnJpdC4xNzgyNzE5OTExMDAwLkljYzE0YjI4NmYyNDA5NzM4YzczODczYWE3NTUwZGNjMDA1ZWU4Y2JiQGdlcnJpdC5vcGVudnBuLm5ldD4= Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.11.5 X-Headers-End: 1wjIzH-0004HN-2S Subject: [Openvpn-devel] [S] Change in openvpn[master]: CMake: detect cmocka_version.h via include path, not by linking X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "cron2 \(Code Review\) via Openvpn-devel" Reply-To: gert@greenie.muc.de, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com, lstipakov@gmail.com Cc: "cron2 \(Code Review\)" , openvpn-devel , plaisthos Content-Type: multipart/mixed; boundary="===============5547928740966773513==" Errors-To: openvpn-devel-bounces@lists.sourceforge.net --===============5547928740966773513== Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="NS7I+XRJqjI="; charset=UTF-8 --NS7I+XRJqjI= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable cron2 has submitted this change=2E ( http://gerrit=2Eopenvpn=2Enet/c/openvp= n/+/1739?usp=3Demail ) Change subject: CMake: detect cmocka_version=2Eh vi= a include path, not by linking =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E CMake: detect cmocka_version=2Eh via include path, not = by linking check_include_files() was invoked with cmocka in CMAKE_REQUIRED= _LIBRARIES, which makes the probe link the (shared, imported) cmocka librar= y=2E On some platforms that link step fails inside the minimal probe, so th= e header check reports failure and HAVE_CMOCKA_VERSION_H is left undefined = even though cmocka_version=2Eh is present=2E test_common=2Eh then selects = its cmocka 1=2Ex compatibility shims and redefines macros (check_expected_u= int, expect_uint_value, =2E=2E=2E) that cmocka 2=2Ex already provides, whic= h breaks the -Werror build of every unit test driver=2E Detecting a header= only needs the include search path, so pass cmocka's INTERFACE_INCLUDE_DIR= ECTORIES via CMAKE_REQUIRED_INCLUDES and drop the library link requirement = from the probe=2E Change-Id: Icc14b286f2409738c73873aa7550dcc005ee8cbb Sig= ned-off-by: Lev Stipakov Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit=2Eopenvpn=2Enet/c/openvp= n/+/1739 Message-Id: <20260709144240=2E61362-1-frank@lichtenheld=2Ecom> URL= : https://www=2Email-archive=2Ecom/openvpn-devel@lists=2Esourceforge=2Enet/= msg37552=2Ehtml Signed-off-by: Gert Doering --- M= CMakeLists=2Etxt 1 file changed, 9 insertions(+), 1 deletion(-) diff -= -git a/CMakeLists=2Etxt b/CMakeLists=2Etxt index 4779d69=2E=2E8de836a 10064= 4 --- a/CMakeLists=2Etxt +++ b/CMakeLists=2Etxt @@ -385,12 +385,20 @@ = find_package(cmocka CONFIG) if (TARGET cmocka::cmocka) set(CM= OCKA_LIBRARIES cmocka::cmocka) + get_target_property(CMOCKA_INCLUDE_= DIRS cmocka::cmocka INTERFACE_INCLUDE_DIRECTORIES) else () pk= g_search_module(cmocka cmocka REQUIRED IMPORTED_TARGET) set(CMOCKA= _LIBRARIES PkgConfig::cmocka) + set(CMOCKA_INCLUDE_DIRS ${cmocka_INC= LUDE_DIRS}) endif () - set(CMAKE_REQUIRED_LIBRARIES ${CMOCKA_LIBRAR= IES}) + # cmocka_version=2Eh exists since cmocka 2=2E0; its absence sele= cts the + # cmocka 1=2Ex compat shims in test_common=2Eh=2E Detecting a = header only needs + # the include path - do NOT add cmocka to CMAKE_REQU= IRED_LIBRARIES, as that + # makes check_include_files link the shared li= brary, which can fail in the + # probe for unrelated reasons and wrongly= mis-detect cmocka 2=2Ex as < 2=2E0=2E + set(CMAKE_REQUIRED_INCLUDES ${C= MOCKA_INCLUDE_DIRS}) check_include_files(cmocka_version=2Eh HAVE_CMOCK= A_VERSION_H) + unset(CMAKE_REQUIRED_INCLUDES) endif () configure_fil= e(config=2Eh=2Ecmake=2Ein config=2Eh) -- To view, visit http://gerrit=2Eo= penvpn=2Enet/c/openvpn/+/1739?usp=3Demail To unsubscribe, or for help writi= ng mail filters, visit http://gerrit=2Eopenvpn=2Enet/settings?usp=3Demail = Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Ge= rrit-Change-Id: Icc14b286f2409738c73873aa7550dcc005ee8cbb Gerrit-Change-Num= ber: 1739 Gerrit-PatchSet: 2 Gerrit-Owner: stipa Ge= rrit-Reviewer: flichtenheld Gerrit-Reviewer: plai= sthos Gerrit-CC: openvpn-devel --NS7I+XRJqjI= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change=2E

View Change

CMake: detect cmocka_version=2Eh via inclu=
de path, not by linking

check_include_files() was invoked with cmock= a in CMAKE_REQUIRED_LIBRARIES,
which makes the probe link the (shared, i= mported) cmocka library=2E On some
platforms that link step fails inside= the minimal probe, so the header check
reports failure and HAVE_CMOCKA_= VERSION_H is left undefined even though
cmocka_version=2Eh is present=2E=

test_common=2Eh then selects its cmocka 1=2Ex compatibility shims a= nd redefines
macros (check_expected_uint, expect_uint_value, =2E=2E=2E) = that cmocka 2=2Ex already
provides, which breaks the -Werror build of ev= ery unit test driver=2E

Detecting a header only needs the include se= arch path, so pass cmocka's
INTERFACE_INCLUDE_DIRECTORIES via CMAKE_= REQUIRED_INCLUDES and drop the library
link requirement from the probe= =2E

Change-Id: Icc14b286f2409738c73873aa7550dcc005ee8cbb
Signed-o= ff-by: Lev Stipakov <lev@openvpn=2Enet>
Acked-by: Frank Lichtenhel= d <frank@lichtenheld=2Ecom>
Gerrit URL: https://gerrit=2Eopenvpn= =2Enet/c/openvpn/+/1739
Message-Id: <20260709144240=2E61362-1-frank@l= ichtenheld=2Ecom>
URL: https://www=2Email-archive=2Ecom/openvpn-devel= @lists=2Esourceforge=2Enet/msg37552=2Ehtml
Signed-off-by: Gert Doering &= lt;gert@greenie=2Emuc=2Ede>
---
M CMakeLists=2Etxt
1 file chang= ed, 9 insertions(+), 1 deletion(-)

diff --git a/CMakeLists=
=2Etxt b/CMakeLists=2Etxt
index 4779d69=2E=2E8de836a 100644=
--- a/CMakeLists=2Etxt
+++ b/CMakeLists=2E= txt
@@ -385,12 +385,20 @@
find_package= (cmocka CONFIG)
if (TARGET cmocka::cmocka)
<= span> set(CMOCKA_LIBRARIES cmocka::cmocka)
+ get_target_property(CMOCKA_INCLUDE_D= IRS cmocka::cmocka INTERFACE_INCLUDE_DIRECTORIES)
else= ()
pkg_search_module(cmocka cmocka REQUIRED IMPOR= TED_TARGET)
set(CMOCKA_LIBRARIES PkgConfig::cmocka= )
+ set(CMOCKA= _INCLUDE_DIRS ${cmocka_INCLUDE_DIRS})
endif ()<= br>- set(CMAKE_REQUIRED_LIBRAR= IES ${CMOCKA_LIBRARIES})
+ # cmocka_version=2Eh exists since cmocka 2=2E0; its absence select= s the
+ # cmocka 1= =2Ex compat shims in test_common=2Eh=2E Detecting a header only needs
+ # the include path - = do NOT add cmocka to CMAKE_REQUIRED_LIBRARIES, as that
+ # makes check_include_files link the= shared library, which can fail in the
+ # probe for unrelated reasons and wrongly mis-detect= cmocka 2=2Ex as < 2=2E0=2E
+ set(CMAKE_REQUIRED_INCLUDES ${CMOCKA_INCLUDE_DIRS}) check_include_files(cmocka_version=2Eh HAVE_CMOCKA_VERSION_H)<= /span>
+ unset(CMAKE_REQU= IRED_INCLUDES)
endif ()

= configure_file(config=2Eh=2Ecmake=2Ein config=2Eh)
=

To view, visit change 1739=2E To unsubscribe, or for help writ= ing mail filters, visit settings=2E

Gerrit-MessageType: = merged
Gerrit-Project: openvpn
<= div style=3D"display:none"> Gerrit-Branch: master
Gerrit-Change-Id: Icc14b286f2409738c73873aa7550dcc005ee8cbb
Gerrit-Change-Number: 1739
Gerrit-PatchSet: 2
= Gerrit-Owner: stipa <lstipakov@gmail=2Ecom>
Gerrit-Reviewer: flichtenheld <frank@lichtenheld=2Ecom>
Gerrit-Reviewer: plaisthos <arne-openv= pn@rfc2549=2Eorg>
Gerrit-CC: openvpn= -devel <openvpn-devel@lists=2Esourceforge=2Enet>
--NS7I+XRJqjI=-- --===============5547928740966773513== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5547928740966773513== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel --===============5547928740966773513==--