Message ID | 20231220123659.55542-1-frank@lichtenheld.com |
---|---|
State | Accepted |
Headers | show |
Series | [Openvpn-devel,v4] cmake: create and link compile_commands.json file | expand |
Since this is build system (-only) and won't affected generated code, I have not tested it. I have an ACK, and the buildbots are happy with it. Your patch has been applied to the master branch. commit 855030f3d76324bdb614c05ec0ca5b86d66653bb Author: Heiko Hund Date: Wed Dec 20 13:36:59 2023 +0100 cmake: create and link compile_commands.json file Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net> Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Message-Id: <20231220123659.55542-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27840.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/.gitignore b/.gitignore index a1da366..4153a3e 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ m4/ltversion.m4 m4/lt~obsolete.m4 +compile_commands.json doc/openvpn-examples.5 doc/openvpn-examples.5.html doc/openvpn.8 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 SYMBOLIC) + # AddressSanitize - use CXX=clang++ CC=clang cmake -DCMAKE_BUILD_TYPE=asan to build with ASAN set(CMAKE_C_FLAGS_ASAN "-fsanitize=address,undefined -fno-sanitize-recover=all -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"