From patchwork Tue Jun 20 13:53:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 15 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:7b9a:b0:c3:1364:a2a2 with SMTP id j26csp3721708dyk; Tue, 20 Jun 2023 06:54:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67HT/0Vc4wyksyYnDHr7TmDfq2K+OVwrRNbmXK3Sy0ZRrEb8TEsttePLiVtoZA5hQarjdK X-Received: by 2002:a17:90a:72c4:b0:25e:9d27:40d4 with SMTP id l4-20020a17090a72c400b0025e9d2740d4mr7054297pjk.40.1687269246399; Tue, 20 Jun 2023 06:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687269246; cv=none; d=google.com; s=arc-20160816; b=e2Afi7qsevc+K14paHYQBCYQHPsEumc/qetUOunMD0A9tE6ghvU6rzyUK9wXSiRpps L4jdC3SfeKy+Dv6L09m+eZU3ChkLv3sInOd4tZm+TjXj1VlvQ/Vw9TaUXLoBDJw5l0Cu zDv0JffFPJu8053Y+wUp4951iJtqdYsL6EjoZ4Np7ZVahJ2LXhpJhWe0e5tbM8VeMPWJ 1GTIOI9S9akYaM2X5cY+CZd/yy6HSH9bnVi0MuN1AhU39pOzwfTPf+eBPghEcThoIhfz 1hXOPywKRr3ev+KWEp+gLkm2yYRW1qRi7aV6/+K2SYxSS4KyeDZOA6pOXjxV3JxlqFQN TPOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=CoPIOGw9ZWwtuBsjSm2NOwyOpLM6i+2WrV8Nah2RpP4=; b=GKr0glyzWviKENsiB0v35L0ldUFQL/WdVZn/kb/3ILBTPamaPfzJdZes0VUfPjl/1p Rs2J+Zi5XmFeLMau+xfrIKs+3z+4Ru9H0JQLypmy0LUHXzhGHCNAVP6Yy97VGrxD2ue6 h8nex7igrhFCU15DeyRqdh1VXG3dCfc+XH7IcwZPC7qDQ4wdYhS/pqs9+SKcb4AI0wqF lvGqAF1iw578YlenS6UoFLkSiVSPXLz0zPbmrV3ce1/+XHzGFOvq8MrmTJa1O1BVMI9g 3iXO41lt1AEO9L2Y1FgokmoMs34ULf4dvMFJAWBFfuHzUrjsT/jzRopRBMZZhd78QXAA 9E2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HFkvABqh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aytRCMqj; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=HsgV4geA; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id c10-20020a170903234a00b001b674055d72si2006255plh.621.2023.06.20.06.54.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2023 06:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HFkvABqh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=aytRCMqj; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=HsgV4geA; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net 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 1qBbnY-0004wr-9b; Tue, 20 Jun 2023 13:53:32 +0000 Received: from [172.30.20.202] (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 1qBbnT-0004wM-GV for openvpn-devel@lists.sourceforge.net; Tue, 20 Jun 2023 13:53:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YbTcfCq9LIOW72h69lWzFRQ7iU6N58PjjqHs1DiWiew=; b=HFkvABqhGThD0ZEoJUmP+QttbS I+N8IyPh/A3puC0VfhvaojXWiJ+CyQnYsSBe0ss9xQFu3Aijpz3M14Xxa71l9x6Pgzcj1yaZccLRG GWRmz4PPybJpV1C28wfXk417mCqyOTpVcx6KUJGSZMjdhNbOxGfuHvsNN9xLm9WqsJEo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YbTcfCq9LIOW72h69lWzFRQ7iU6N58PjjqHs1DiWiew=; b=aytRCMqjCDuoUcatEuLnDmY9s8 yk3qeoF3Tj994EN6wA5SpYBi0IJu5epU2MCwjDJZKppZ+sLpf7fs5hLItCdavscueJ73cFQ3JGhxE apUl9+gjEh7MMywXKgqo1rnEqGefksZ1qAEdlAj64SgVG8sebtGBxHLeWQ7gb4sHIyik=; Received: from mout-p-202.mailbox.org ([80.241.56.172]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qBbnP-0001gz-85 for openvpn-devel@lists.sourceforge.net; Tue, 20 Jun 2023 13:53:27 +0000 Received: from smtp1.mailbox.org (unknown [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Qlp4R25nlz9sTS for ; Tue, 20 Jun 2023 15:53:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1687269191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YbTcfCq9LIOW72h69lWzFRQ7iU6N58PjjqHs1DiWiew=; b=HsgV4geAtcgmVfWJVo12OyvJ66Dpa46bBY3k/mhxQLBB1nstp66TnxfcGHI/QD2FyYVMzi ZguumLbuNRug22G6/gwQVTRuhjMhTFJ1QSVCzPfDY6tX+kmWtDggtvMxsLR5DQBofMd1fj yDfV+t3dzvfaKgJ94GzSjp0yLXMyxy+dQ6qZif3uwhNLEfD+L0JirqnnP86qXenWfku8Pe c60lGUQ0Qd0G9vRR7w2AL0qumatbEMLTll5pi+VX/vT2xsMIpc3XiOxZbs5KygQaLm01Nd Ld31r3diQSEz5A4cn38xgPG5kAshrSL4i8KyW2BuV0RglbPXIIhKRvs84EzGsg== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 20 Jun 2023 15:53:05 +0200 Message-Id: <20230620135310.94455-1-frank@lichtenheld.com> In-Reply-To: <20230509111205.138997-1-frank@lichtenheld.com> References: <20230509111205.138997-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Posted here to make people aware of the patch set. Reviews can also be done via https://gerrit.openvpn.net/ Also available as a branch at https://github.com/flichtenheld/openvpn/tree/cmake Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1qBbnP-0001gz-85 Subject: [Openvpn-devel] [PATCH v3 0/5] Switch to CMake for Windows builds 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1765414878471715113?= X-GMAIL-MSGID: =?utf-8?q?1769230037202037607?= Posted here to make people aware of the patch set. Reviews can also be done via https://gerrit.openvpn.net/ Also available as a branch at https://github.com/flichtenheld/openvpn/tree/cmake openvpn-build branch to build MSIs based on this patch set available at https://github.com/OpenVPN/openvpn-build/tree/flichtenheld-cmake This is based on the initial CMake patch by Arne Schwabe, but extends that to provide a complete replacement for existing MinGW build (autotools based) and MSVC build (openvpn.sln). The first patch in the series is Arne's original patch to document his authorship. It makes not a whole lot of sense to review that in isolation and I will not apply any fixes to it. All changes go into the second patch. The following features are added while switching these builds to CMake: - vcpkg support for MinGW build, allowing for trivial cross-compilation on Linux - Add unittests to MSVC build - Rework MSVC config header generation, removing need for separate headers between autotools and MSVC The following advantages are reasons for switching to CMake over the existing MSVC build: - Easier to maintain CMake files without IDE than the sln and vcxproj files - Able to maintain MSVC and MinGW build side-by-side The plan is to completely remove the existing MSVC build system but leave the existing autotools builds in place as-is, including MinGW support. CMake is not the intended build system for Unix-like platforms and there are no current plans to switch to it. v2: - Change MSVC build presets from multi-config to single config due to build problems. - See commit mails for more details. v3: - Various changes to MSVC compile/link options after review by Lev Stipakov. See commit mails for more details. - Move /Brepro change to its own commit since this is a change to the MSVC build not directly related to CMake switch. - Rebased on top of my "dist" patch series. Arne Schwabe (1): add basic CMake based build Frank Lichtenheld (4): CMake: Add complete MinGW and MSVC build Remove all traces of the previous MSVC build system CMake: Add /Brepro to MSVC link options GHA: update to run-vcpkg@v11 .github/workflows/build.yaml | 300 ++----- .gitignore | 12 +- CMakeLists.txt | 766 ++++++++++++++++++ CMakePresets.json | 228 ++++++ Makefile.am | 12 +- build/Makefile.am | 2 - build/msvc/Makefile.am | 15 - build/msvc/msvc-generate/Makefile.am | 20 - build/msvc/msvc-generate/Makefile.mak | 67 -- build/msvc/msvc-generate/msvc-generate.js | 118 --- .../msvc/msvc-generate/msvc-generate.vcxproj | 158 ---- build/msvc/msvc-generate/version.m4.in | 3 - config-msvc-version.h.in | 14 - config-msvc.h | 93 --- config.h.cmake.in | 479 +++++++++++ configure.ac | 2 - .../cmake}/git-version.py | 0 contrib/cmake/parse-version.m4.py | 58 ++ contrib/vcpkg-manifests/mingw/vcpkg.json | 13 + contrib/vcpkg-manifests/windows/vcpkg.json | 20 + .../vcpkg-ports/pkcs11-helper/portfile.cmake | 22 +- doc/CMakeLists.txt | 81 ++ doc/Makefile.am | 3 +- openvpn.sln | 107 --- src/compat/Debug.props | 21 - src/compat/Makefile.am | 6 - src/compat/PropertySheet.props | 29 - src/compat/Release.props | 26 - src/compat/compat-basename.c | 2 - src/compat/compat-daemon.c | 2 - src/compat/compat-dirname.c | 2 - src/compat/compat-gettimeofday.c | 2 - src/compat/compat-strsep.c | 2 - src/compat/compat.vcxproj | 179 ---- src/openvpn/Makefile.am | 4 +- src/openvpn/argv.c | 2 - src/openvpn/auth_token.c | 2 - src/openvpn/base64.c | 2 - src/openvpn/block_dns.c | 2 - src/openvpn/buffer.c | 2 - src/openvpn/clinat.c | 2 - src/openvpn/comp-lz4.c | 2 - src/openvpn/comp.c | 2 - src/openvpn/compstub.c | 2 - src/openvpn/console.c | 2 - src/openvpn/console_builtin.c | 2 - src/openvpn/crypto.c | 2 - src/openvpn/crypto_mbedtls.c | 2 - src/openvpn/crypto_openssl.c | 2 - src/openvpn/cryptoapi.c | 2 - src/openvpn/dco.c | 2 - src/openvpn/dco_freebsd.c | 2 - src/openvpn/dco_linux.c | 2 - src/openvpn/dco_win.c | 2 - src/openvpn/dhcp.c | 2 - src/openvpn/dns.c | 2 - src/openvpn/env_set.c | 2 - src/openvpn/error.c | 2 - src/openvpn/event.c | 2 - src/openvpn/fdmisc.c | 2 - src/openvpn/forward.c | 2 - src/openvpn/fragment.c | 2 - src/openvpn/gremlin.c | 2 - src/openvpn/helper.c | 2 - src/openvpn/httpdigest.c | 2 - src/openvpn/init.c | 2 - src/openvpn/interval.c | 2 - src/openvpn/list.c | 2 - src/openvpn/lladdr.c | 2 - src/openvpn/lzo.c | 2 - src/openvpn/lzo.h | 9 +- src/openvpn/manage.c | 2 - src/openvpn/mbuf.c | 2 - src/openvpn/misc.c | 2 - src/openvpn/mroute.c | 2 - src/openvpn/mss.c | 2 - src/openvpn/mstats.c | 2 - src/openvpn/mtcp.c | 2 - src/openvpn/mtu.c | 2 - src/openvpn/mudp.c | 2 - src/openvpn/multi.c | 2 - src/openvpn/networking_freebsd.c | 2 - src/openvpn/networking_iproute2.c | 2 - src/openvpn/networking_sitnl.c | 2 - src/openvpn/ntlm.c | 2 - src/openvpn/occ.c | 2 - src/openvpn/openssl_compat.h | 2 - src/openvpn/openvpn.c | 2 - src/openvpn/openvpn.vcxproj | 470 ----------- src/openvpn/openvpn_win32_resources.rc | 2 - src/openvpn/options.c | 2 - src/openvpn/options_util.c | 2 - src/openvpn/otime.c | 2 - src/openvpn/packet_id.c | 2 - src/openvpn/perf.c | 2 - src/openvpn/ping.c | 2 - src/openvpn/pkcs11.c | 2 - src/openvpn/pkcs11_mbedtls.c | 2 - src/openvpn/pkcs11_openssl.c | 2 - src/openvpn/platform.c | 2 - src/openvpn/plugin.c | 2 - src/openvpn/pool.c | 2 - src/openvpn/proto.c | 2 - src/openvpn/proxy.c | 2 - src/openvpn/ps.c | 2 - src/openvpn/push.c | 2 - src/openvpn/reflect_filter.c | 2 - src/openvpn/reliable.c | 2 - src/openvpn/route.c | 2 - src/openvpn/run_command.c | 2 - src/openvpn/schedule.c | 2 - src/openvpn/session_id.c | 2 - src/openvpn/shaper.c | 2 - src/openvpn/sig.c | 2 - src/openvpn/socket.c | 2 - src/openvpn/socks.c | 2 - src/openvpn/ssl.c | 2 - src/openvpn/ssl_mbedtls.c | 2 - src/openvpn/ssl_ncp.c | 2 - src/openvpn/ssl_openssl.c | 2 - src/openvpn/ssl_pkt.c | 2 - src/openvpn/ssl_util.c | 2 - src/openvpn/ssl_verify.c | 2 - src/openvpn/ssl_verify_mbedtls.c | 2 - src/openvpn/ssl_verify_openssl.c | 2 - src/openvpn/status.c | 2 - src/openvpn/tls_crypt.c | 2 - src/openvpn/tun.c | 2 - src/openvpn/vcpkg.json | 15 - src/openvpn/vlan.c | 2 - src/openvpn/win32-util.c | 2 - src/openvpn/win32.c | 2 - src/openvpn/xkey_helper.c | 2 - src/openvpn/xkey_provider.c | 2 - src/openvpnmsica/CMakeLists.txt | 36 + src/openvpnmsica/Makefile.am | 9 +- src/openvpnmsica/dllmain.c | 2 - src/openvpnmsica/msica_arg.c | 2 - src/openvpnmsica/msiex.c | 2 - src/openvpnmsica/openvpnmsica-Debug.props | 14 - src/openvpnmsica/openvpnmsica-Release.props | 15 - src/openvpnmsica/openvpnmsica.c | 2 - src/openvpnmsica/openvpnmsica.props | 17 - src/openvpnmsica/openvpnmsica.vcxproj | 208 ----- src/openvpnmsica/openvpnmsica_resources.rc | 2 - src/openvpnserv/CMakeLists.txt | 34 + src/openvpnserv/Makefile.am | 6 +- src/openvpnserv/openvpnserv.vcxproj | 229 ------ src/openvpnserv/openvpnserv_resources.rc | 2 - src/openvpnserv/service.h | 2 - src/tapctl/CMakeLists.txt | 31 + src/tapctl/Makefile.am | 9 +- src/tapctl/main.c | 2 - src/tapctl/tap.c | 2 - src/tapctl/tapctl.props | 18 - src/tapctl/tapctl.vcxproj | 205 ----- src/tapctl/tapctl_resources.rc | 2 - tests/unit_tests/openvpn/mock_msg.c | 2 - tests/unit_tests/openvpn/pkey_test_utils.c | 2 - tests/unit_tests/openvpn/test_auth_token.c | 2 - tests/unit_tests/openvpn/test_buffer.c | 2 - tests/unit_tests/openvpn/test_crypto.c | 2 - tests/unit_tests/openvpn/test_cryptoapi.c | 2 - tests/unit_tests/openvpn/test_misc.c | 2 - tests/unit_tests/openvpn/test_ncp.c | 2 - tests/unit_tests/openvpn/test_packet_id.c | 2 - tests/unit_tests/openvpn/test_pkcs11.c | 2 - tests/unit_tests/openvpn/test_pkt.c | 2 - tests/unit_tests/openvpn/test_provider.c | 2 - tests/unit_tests/openvpn/test_tls_crypt.c | 2 - 170 files changed, 1869 insertions(+), 2562 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 CMakePresets.json delete mode 100644 build/msvc/Makefile.am delete mode 100644 build/msvc/msvc-generate/Makefile.am delete mode 100644 build/msvc/msvc-generate/Makefile.mak delete mode 100644 build/msvc/msvc-generate/msvc-generate.js delete mode 100644 build/msvc/msvc-generate/msvc-generate.vcxproj delete mode 100644 build/msvc/msvc-generate/version.m4.in delete mode 100644 config-msvc-version.h.in delete mode 100644 config-msvc.h create mode 100644 config.h.cmake.in rename {build/msvc/msvc-generate => contrib/cmake}/git-version.py (100%) create mode 100644 contrib/cmake/parse-version.m4.py create mode 100644 contrib/vcpkg-manifests/mingw/vcpkg.json create mode 100644 contrib/vcpkg-manifests/windows/vcpkg.json create mode 100644 doc/CMakeLists.txt delete mode 100644 openvpn.sln delete mode 100644 src/compat/Debug.props delete mode 100644 src/compat/PropertySheet.props delete mode 100644 src/compat/Release.props delete mode 100644 src/compat/compat.vcxproj delete mode 100644 src/openvpn/openvpn.vcxproj delete mode 100644 src/openvpn/vcpkg.json create mode 100644 src/openvpnmsica/CMakeLists.txt delete mode 100644 src/openvpnmsica/openvpnmsica-Debug.props delete mode 100644 src/openvpnmsica/openvpnmsica-Release.props delete mode 100644 src/openvpnmsica/openvpnmsica.props delete mode 100644 src/openvpnmsica/openvpnmsica.vcxproj create mode 100644 src/openvpnserv/CMakeLists.txt delete mode 100644 src/openvpnserv/openvpnserv.vcxproj create mode 100644 src/tapctl/CMakeLists.txt delete mode 100644 src/tapctl/tapctl.props delete mode 100644 src/tapctl/tapctl.vcxproj