vscode-cmake-tools: CXX Variable not set
Brief Issue Summary
Visual Studio Code Version: 1.62.2 OS Version: Linux x64 5.13.19-2-MANJARO Extension Version: 1.9.1 (Latest?)
CXX variable is not set when I try to scan active kits.
As you can see, I set my kit to a compiler that is not a defaulted system one (my default gcc/g++ compiler is gcc-11)
Then, if I generate my project, cmake give me this output:
[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/bin/x86_64-pc-linux-gnu-gcc-10.3.0 -H/home/pablo/personal/cppStuff/fileBin -B/home/pablo/personal/cppStuff/fileBin/build -G "Unix Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is GNU 10.3.0
[cmake] -- The CXX compiler identification is GNU 11.1.0
As you can see, the variable CMAKE_C_COMPILER
is set, but not the CMAKE_CXX_COMPILER
one.
If I try on a Debian OS, both variables are set when I scan for Active kits
So to solve this “problem” I modified the file ${HOME}/.local/share/CMakeTools/cmake-tools-kits.json
and added manually all CXX
variables.
For example: Generated by automated searching kits:
{
"name": "Clang 12.0.1 x86_64-pc-linux-gnu",
"compilers": {
"C": "/bin/clang-12"
}
}
CXX Variable is not set, so I added a new entry:
{
"name": "Clang 12",
"compilers": {
"C": "/bin/clang",
"CXX": "/bin/clang++"
}
}
This happens with al compilers, and versions. CXX variable should not be added too automatically?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (8 by maintainers)
It sounds not good. Arch Linux frequently updates the compiler and I have to modify the configure each time 😦