[PATCH 4/4] CMakeLists.txt: enable CMAKE_EXPORT_COMPILE_COMMANDS by default
yegorslists at googlemail.com
yegorslists at googlemail.com
Thu Jun 5 23:55:58 PDT 2025
From: Yegor Yefremov <yegorslists at googlemail.com>
This creates a compile_commands.json file that can then be used
by the clangd tool.
Signed-off-by: Yegor Yefremov <yegorslists at googlemail.com>
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 60ba81a..627690f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@ INCLUDE(CheckFunctionExists)
PROJECT(ubox C)
+# Create compile_commands.json file
+SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
ADD_DEFINITIONS(-Wall -Werror)
IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6)
ADD_DEFINITIONS(-Wextra -Werror=implicit-function-declaration)
--
2.34.1
More information about the openwrt-devel
mailing list