From: "stipa (Code Review)" Date: Fri, 12 Jan 2024 12:43:22 +0000 In-Reply-To: References: Reply-To: lstipakov@...277..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <7fe210802557152c826b3da6c157a0d43f7678a1-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="JW/yfOUCno0="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: CMakeLists.txt: Don't fail on missing compile_commands.json List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --JW/yfOUCno0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/495?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: CMakeLists.txt: Don't fail on missing compile_commands.json ...................................................................... CMakeLists.txt: Don't fail on missing compile_commands.json Commit 855030f3 ("cmake: create and link compile_commands.json file") added creation of compile commands file and a symbolic link to it. There a two issues: - CMAKE_EXPORT_COMPILE_COMMANDS works only on Ninja and Makefile generators and doesn't produce anything on MSVC. - creating symlink on Windows by default requires an elevated prompt, which is not normally the case (but it turned out is the case for GHA). Without elevated prompt this fails the build. Fix by make symlink creation non-fatal by providing variable to store result. Change-Id: Ic19f859c3aca8b30aa51b12dcb906a6e7e735019 Signed-off-by: Lev Stipakov --- M CMakeLists.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/95/495/2 diff --git a/CMakeLists.txt b/CMakeLists.txt index bc46c27..5c6fff0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ # 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) + ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json RESULT = COMPILE_COMMANDS_CREATED SYMBOLIC) # AddressSanitize - use CXX=3Dclang++ CC=3Dclang cmake -DCMAKE_BUILD_TYPE= =3Dasan to build with ASAN set(CMAKE_C_FLAGS_ASAN -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/495?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: Ic19f859c3aca8b30aa51b12dcb906a6e7e735019 Gerrit-Change-Number: 495 Gerrit-PatchSet: 2 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --JW/yfOUCno0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

stipa uploaded patch set #2 to this change.

View Change

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

CMakeLists.txt: Don't fail on missing com=
pile_commands.json

Commit

855030f3 ("cmake: create a= nd link compile_commands.json file")

added creation of compile = commands file and a symbolic link to it.

There a two issues:

= - CMAKE_EXPORT_COMPILE_COMMANDS works only on Ninja and Makefile
genera= tors and doesn't produce anything on MSVC.

- creating symlink o= n Windows by default requires an elevated prompt,
which is not normally = the case (but it turned out is the case for GHA).
Without elevated promp= t this fails the build.

Fix by make symlink creation non-fatal by pr= oviding variable
to store result.

Change-Id: Ic19f859c3aca8b30aa5= 1b12dcb906a6e7e735019
Signed-off-by: Lev Stipakov <lev@...515...><= br>---
M CMakeLists.txt
1 file changed, 1 insertion(+), 1 deletion(-)=

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/95/=
495/2
diff --git a/CMakeLists.txt b/CMakeLists.txt
= index bc46c27..5c6fff0 100644
--- a/CMakeLists.txt+++ b/CMakeLists.txt
@@ -45,7 +45,7 @@
# Create machine readable compile commands
set(CMAKE_= EXPORT_COMPILE_COMMANDS 1)
file(CREATE_LINK ${CMAKE_CURREN= T_BINARY_DIR}/compile_commands.json
- ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands= .json SYMBOLIC)
+ = ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json RESULT COMPI= LE_COMMANDS_CREATED SYMBOLIC)

# AddressS= anitize - use CXX=3Dclang++ CC=3Dclang cmake -DCMAKE_BUILD_TYPE=3Dasan to b= uild with ASAN
set(CMAKE_C_FLAGS_ASAN

To view, visit change 495. To unsubscribe, or for help writing m= ail filters, visit settings<= /a>.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic19f859c3aca8b30aa51b12dcb9= 06a6e7e735019
Gerrit-Change-Number: 495
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <lstipakov@...277...>= ;
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-MessageType: newpatchset
--JW/yfOUCno0=--