vscode-cmake-tools
vscode-cmake-tools copied to clipboard
Unable to set a header path as -isystem in clang-tidy?
Environment
- OS and Version: Ubuntu 22.04
- VS Code Version: 1.80.1
- C/C++ Extension Version: 1.16.3
- If using SSH remote, specify OS of remote machine: Rocky Linux 8
Bug Summary and Steps to Reproduce
Bug Summary:
I am using the CMake extension and a custom build of Boost installed to a separate directory under /opt. CMake is building a compile_commands.json that adds it as -isystem . clang-tidy is adding it as -I , which is triggering various errors that I don't care about.
I've tried setting compileCommands "C_Cpp.default.compileCommands" and "C_Cpp.codeAnalysis.clangTidy.useBuildPath": true but then I get other basic include errors (e.g. "'stddef.h' file not found"), so I'm not sure if this fixes my issue or not.
It looks like "C_Cpp.codeAnalysis.clangTidy.args" may only apply to arguments before the filename being tested, so I haven't been able to see if I can override the -I with a -isystem.
Configuration and Logs
C_Cpp settings (taken from workspace file, as I do not have a c_cpp_properties.json):
"C_Cpp.clang_format_style": "file:${workspaceFolder}/XXXX/vscode/.clang-format",
"C_Cpp.codeAnalysis.clangTidy.args": [
"--config-file=${workspaceFolder}/XXXX/vscode/.clang-tidy"
],
"C_Cpp.codeAnalysis.exclude": {
// Various paths of 3rd party generated code.
},
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"C_Cpp.vcpkg.enabled": false,
-------- Diagnostics - 7/17/2023, 1:29:49 PM
Version: 1.16.3
Current Configuration:
{
"name": "Linux",
"includePath": [
"XXXX/master/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64",
"compilerPathInCppPropertiesJson": "/usr/bin/gcc",
"intelliSenseModeIsExplicit": false,
"cStandardIsExplicit": false,
"cppStandardIsExplicit": false,
"mergeConfigurations": false,
"compilerPathIsExplicit": false,
"configurationProvider": "ms-vscode.cmake-tools",
"browse": {
"path": [
"${workspaceFolder}/**"
],
"limitSymbolsToIncludedHeaders": true
}
}
Custom browse configuration:
{
"browsePath": [
"XXXX/obj/CMakeFiles",
....
"/opt/XXXX/XXXX-boost/include",
....
],
"compilerPath": "/opt/rh/gcc-toolset-11/root/usr/bin/c++",
"compilerArgs": [],
"compilerFragments": [
"-g",
"-Wall",
"-Wextra",
"-Werror",
"-Wno-deprecated-copy",
"-std=gnu++17"
]
}
Custom configurations:
[ XXXX/core/tests/layer_decoder.cpp ]
{
"includePath": [
"XXXX/include",
....
"/opt/XXXX/XXXX-boost/include"
],
"defines": [
"BOOST_THREAD_DYN_LINK",
"BOOST_THREAD_NO_LIB",
"BOOST_UNIT_TEST_FRAMEWORK_DYN_LINK",
"BOOST_UNIT_TEST_FRAMEWORK_NO_LIB",
"FMT_SHARED"
],
"compilerPath": "/opt/rh/gcc-toolset-11/root/usr/bin/c++",
"compilerArgs": [],
"compilerFragments": [
"-g",
"-Wall",
"-Wextra",
"-Werror",
"-Wno-deprecated-copy",
"-pthread",
"-std=gnu++17"
]
}
cpptools version (native): 1.16.3.0
Translation Unit Mappings:
[ XXXX/core/tests/layer_decoder.cpp ]:
XXXX/core/tests/layer_decoder.cpp
Translation Unit Configurations:
[ XXXX/core/tests/layer_decoder.cpp ]:
Process ID: 3579914
Memory Usage: 684 MB
Compiler Path: /opt/rh/gcc-toolset-11/root/usr/bin/c++
Includes:
....
/opt/XXXX/XXXX-boost/include
....
/opt/rh/gcc-toolset-11/root/usr/include/c++/11
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/x86_64-redhat-linux
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/backward
/opt/rh/gcc-toolset-11/root/usr/lib/gcc/x86_64-redhat-linux/11/include
/usr/local/include
/opt/rh/gcc-toolset-11/root/usr/include
/usr/include
Defines:
BOOST_THREAD_DYN_LINK
BOOST_THREAD_NO_LIB
BOOST_UNIT_TEST_FRAMEWORK_DYN_LINK
BOOST_UNIT_TEST_FRAMEWORK_NO_LIB
FMT_SHARED
Standard Version: c++17
IntelliSense Mode: linux-gcc-x64
Other Flags:
--g++
--gnu_version=110201
Total Memory Usage: 684 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 24486
Number of files parsed: 9734
Other Extensions
ms-vscode.cmake-tools
Additional context
No response