From f0cf28e5da6a0e01eee23bf90862dadda48826a1 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Fri, 5 Apr 2024 15:37:42 +0100 Subject: [PATCH] Generate compile_commands.json Fixes #6, and possibly other intellisense bugs Signed-off-by: William Vinnicombe --- scripts/pico_project.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/pico_project.py b/scripts/pico_project.py index f68edffc..25215464 100644 --- a/scripts/pico_project.py +++ b/scripts/pico_project.py @@ -538,7 +538,8 @@ def GenerateCMake(folder, params): cmake_header1 = (f"# Generated Cmake Pico project file\n\n" "cmake_minimum_required(VERSION 3.13)\n\n" "set(CMAKE_C_STANDARD 11)\n" - "set(CMAKE_CXX_STANDARD 17)\n\n" + "set(CMAKE_CXX_STANDARD 17)\n" + "set(CMAKE_EXPORT_COMPILE_COMMANDS ON)\n\n" "# Initialise pico_sdk from installed location\n" "# (note this can come from environment, CMake cache etc)\n\n" ) @@ -839,6 +840,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger, ], "defines": [], "compilerPath": "{cPath}", + "compileCommands": "${{workspaceFolder}}/build/compile_commands.json", "cStandard": "c17", "cppStandard": "c++14", "intelliSenseMode": "linux-gcc-arm"