VSCode C/C++ include path and config hints

This commit is contained in:
Peter van der Perk 2023-01-12 16:17:12 +01:00 committed by Daniel Agar
parent c97381c97f
commit 7d92d4893e
4 changed files with 38 additions and 3 deletions

1
.vscode/.gitignore vendored
View File

@ -4,6 +4,7 @@ compile_commands.json
# generated by cmake
launch.json
c_cpp_properties.json
# C/C++ extension does some local caching in this folder
ipch/

View File

@ -63,4 +63,10 @@ endif()
add_subdirectory(px4_work_queue)
add_subdirectory(work_queue)
if("${PX4_PLATFORM}" MATCHES "nuttx")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/c_cpp_properties.json.nuttx.in ${PX4_SOURCE_DIR}/.vscode/c_cpp_properties.json @ONLY)
else()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/c_cpp_properties.json.in ${PX4_SOURCE_DIR}/.vscode/c_cpp_properties.json @ONLY)
endif()
px4_add_unit_gtest(SRC board_identity_test.cpp LINKLIBS px4_platform)

View File

@ -3,14 +3,18 @@
{
"name": "PX4",
"includePath": [
"${workspaceFolder}/**"
"${workspaceFolder}/**",
],
"defines": [],
"macFrameworkPath": [],
"configurationProvider": "ms-vscode.cmake-tools",
"cppStandard": "c++14",
"cStandard": "c11"
"cStandard": "c11",
"forcedInclude": [
"@PX4_BINARY_DIR@/px4_boardconfig.h",
"@PX4_SOURCE_DIR@/platforms/common/include/px4_platform_common/defines.h"
]
}
],
"version": 4
}
}

View File

@ -0,0 +1,24 @@
{
"configurations": [
{
"name": "PX4",
"includePath": [
"${workspaceFolder}/**",
"@PX4_BOARD_DIR@/src",
"@PX4_SOURCE_DIR@/platforms/nuttx/src/px4/@PX4_CHIP_MANUFACTURER@/@PX4_CHIP@/include",
"@PX4_SOURCE_DIR@/platforms/nuttx/NuttX/nuttx/include/"
],
"defines": [],
"macFrameworkPath": [],
"configurationProvider": "ms-vscode.cmake-tools",
"cppStandard": "c++14",
"cStandard": "c11",
"dotConfig": "@PX4_BINARY_DIR@/NuttX/nuttx/.config",
"forcedInclude": [
"@PX4_BINARY_DIR@/px4_boardconfig.h",
"@PX4_SOURCE_DIR@/platforms/common/include/px4_platform_common/defines.h"
]
}
],
"version": 4
}