Skip to content

Commit f0cf28e

Browse files
committed
Generate compile_commands.json
Fixes #6, and possibly other intellisense bugs Signed-off-by: William Vinnicombe <[email protected]>
1 parent 25abc6a commit f0cf28e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/pico_project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ def GenerateCMake(folder, params):
538538
cmake_header1 = (f"# Generated Cmake Pico project file\n\n"
539539
"cmake_minimum_required(VERSION 3.13)\n\n"
540540
"set(CMAKE_C_STANDARD 11)\n"
541-
"set(CMAKE_CXX_STANDARD 17)\n\n"
541+
"set(CMAKE_CXX_STANDARD 17)\n"
542+
"set(CMAKE_EXPORT_COMPILE_COMMANDS ON)\n\n"
542543
"# Initialise pico_sdk from installed location\n"
543544
"# (note this can come from environment, CMake cache etc)\n\n"
544545
)
@@ -839,6 +840,7 @@ def generateProjectFiles(projectPath, projectName, sdkPath, projects, debugger,
839840
],
840841
"defines": [],
841842
"compilerPath": "{cPath}",
843+
"compileCommands": "${{workspaceFolder}}/build/compile_commands.json",
842844
"cStandard": "c17",
843845
"cppStandard": "c++14",
844846
"intelliSenseMode": "linux-gcc-arm"

0 commit comments

Comments
 (0)