From: Mike Stepanek (mstepane) Date: Tue, 5 Aug 2025 03:43:18 +0000 (+0000) Subject: Pull request #4843: build: enable exporting compile commands X-Git-Tag: 3.9.3.0~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4dc83f25960b2beb861a19ed30a032e38418072c;p=thirdparty%2Fsnort3.git Pull request #4843: build: enable exporting compile commands Merge in SNORT/snort3 from ~MSTEPANE/snort3:export_compile_commands to master Squashed commit of the following: commit 247085b9aad6834ab92cdc504ab64edd764deb3f Author: mstepane Date: Thu Jul 31 09:00:48 2025 -0400 build: enable exporting compile commands --- diff --git a/.gitignore b/.gitignore index def2f38af..67c8fc52a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,11 @@ *.trs *~ ._Xcode* +.cache/ .vscode/ Cbuild/ Xcode*/ +compile_commands.json doc/basic.txt doc/builtin.txt doc/codec.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 110797ddf..6beb2c08f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,9 @@ set (CMAKE_C_STANDARD 99) set (CMAKE_C_STANDARD_REQUIRED ON) set (CMAKE_C_EXTENSIONS ON) +# dump compile_commands.json to make it easier to use clangd with IDEs +set (CMAKE_EXPORT_COMPILE_COMMANDS ON) + set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") # Pull in definitions of various install directories include (GNUInstallDirs)