From: "d12fk (Code Review)" Date: Mon, 18 Dec 2023 11:47:11 +0000 In-Reply-To: References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <6c6950dda16d17596092b276edaea53f304eb20f-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="KtTSqAAiEP0="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: cmake: create and link compile_commands.json file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --KtTSqAAiEP0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: d12fk, flichtenheld, plaisthos. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/483?usp=3Demail to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld Change subject: cmake: create and link compile_commands.json file ...................................................................... cmake: create and link compile_commands.json file CMake has support to create a json file which contains exact information how each file in the project is compiled. This file can be consumed by clangd, which in turn provides precise symbol information to IDEs for better code navigation and contextual information. I use it with vscode to be able to quickly switch between native Linux and mingw builds and have the symbols info change dynamically with it. So handy that I think it is useful for others as well. Bump required CMake version for CREATE_LINK. Change-Id: Ib14c1161b4b0c9df797b9932ad14739e202cea64 Signed-off-by: Heiko Hund --- M CMakeLists.txt 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/83/483/3 diff --git a/CMakeLists.txt b/CMakeLists.txt index d40b213..bc46c27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.14) set(CMAKE_CONFIGURATION_TYPES "Release;Debug;ASAN") project(openvpn) @@ -42,6 +42,11 @@ set(PLUGIN_DIR /usr/local/lib/openvpn/plugins CACHE FILEPATH "Location of = the plugin directory") +# Create machine readable compile commands +set(CMAKE_EXPORT_COMPILE_COMMANDS 1) +file(CREATE_LINK ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json + ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json SYMBOLI= C) + # AddressSanitize - use CXX=3Dclang++ CC=3Dclang cmake -DCMAKE_BUILD_TYPE= =3Dasan to build with ASAN set(CMAKE_C_FLAGS_ASAN "-fsanitize=3Daddress,undefined -fno-sanitize-recover=3Dall -fno-optim= ize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointe= r -g -O1" --=20 To view, visit http://gerrit.openvpn.net/c/openvpn/+/483?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: Ib14c1161b4b0c9df797b9932ad14739e202cea64 Gerrit-Change-Number: 483 Gerrit-PatchSet: 3 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: d12fk Gerrit-MessageType: newpatchset --KtTSqAAiEP0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: d12fk, flichtenheld, plaisthos. <= /p>

d12fk uploaded patch set #3 to this change.

View Change

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

cmake: create and link compile_commands.json =
file

CMake has support to create a json file which contains exact in= formation
how each file in the project is compiled. This file can be con= sumed by
clangd, which in turn provides precise symbol information to ID= Es for
better code navigation and contextual information.

I use i= t with vscode to be able to quickly switch between native Linux and
ming= w builds and have the symbols info change dynamically with it. So
handy = that I think it is useful for others as well.

Bump required CMake ve= rsion for CREATE_LINK.

Change-Id: Ib14c1161b4b0c9df797b9932ad14739e2= 02cea64
Signed-off-by: Heiko Hund <heiko@...2662...>
---
M C= MakeLists.txt
1 file changed, 6 insertions(+), 1 deletion(-)

g=
it pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/83/483/3
<= pre style=3D"font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/CMakeLists.txt b/CMakeLists.txt
index d40b21= 3..bc46c27 100644
--- a/CMakeLists.txt
+++ = b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.12)
<= span style=3D"color: hsl(120, 100%, 40%);">+cmake_minimum_required(VERSION = 3.14)
set(CMAKE_CONFIGURATION_TYPES "Release;Debug;AS= AN")
project(openvpn)

@@ -42,6 +42,11 @@

set(PLUGIN_DIR /us= r/local/lib/openvpn/plugins CACHE FILEPATH "Location of the plugin dir= ectory")

+# Create machine readable compile commands
+set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

+file(CREATE_LINK ${CMAK= E_CURRENT_BINARY_DIR}/compile_commands.json
+ ${CMAKE_CURRENT_SOURCE_DIR}/compil= e_commands.json SYMBOLIC)
+
# AddressSanitize - use CXX=3Dclang++ CC=3Dclang cm= ake -DCMAKE_BUILD_TYPE=3Dasan to build with ASAN
set(CMAKE= _C_FLAGS_ASAN
"-fsanitize=3Daddress,undefined -fn= o-sanitize-recover=3Dall -fno-optimize-sibling-calls -fsanitize-address-use= -after-scope -fno-omit-frame-pointer -g -O1"

To view, visit change 483. To unsubscribe, or for help writing mail f= ilters, visit settings.<= /p>

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib14c1161b4b0c9df797b9932ad1= 4739e202cea64
Gerrit-Change-Number: 483
Gerrit-PatchSet: 3
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: d12fk <heiko@...515...>= ;
Gerrit-MessageType: newpatchset
--KtTSqAAiEP0=--