How to correctly set IntelliSense Mode in cpptools with cmake tools? #2740
-
BackgroundI'm using a custom toolchain file to cross-build Windows mingw binary from Linux clang. Currently the toolchain file sets following: set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER "/usr/bin/clang-10" CACHE PATH "")
set(CMAKE_CXX_COMPILER "/usr/bin/clang++-10" CACHE PATH "")
set(CMAKE_C_COMPILER_TARGET "i686-w64-mingw32")
set(CMAKE_CXX_COMPILER_TARGET "i686-w64-mingw32")
# --snip-- settings.json {
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
} SymptomI hoped that it'll tell cpptools that I'm building a Windows binary, but IntelliSense is erroneously working in Linux mode. For example The C++ Log diagnostics says:
which is not correct. How does the cmake-tools pass the triplet info to the cpptools? What should I do to fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We don't currently have any special support for cross-compilation. We'll need to do some investigation here and see if we can extract the cross compile information from the CMakeCache.txt or the cmake-file-api so that we know to send the correct IntelliSense mode. Otherwise, our default behavior is to let cpptools decide. If the target is being sent on the command line though, cpptools may be able to make the decision for us. I'll talk to @Colengms about it. |
Beta Was this translation helpful? Give feedback.
We don't currently have any special support for cross-compilation. We'll need to do some investigation here and see if we can extract the cross compile information from the CMakeCache.txt or the cmake-file-api so that we know to send the correct IntelliSense mode. Otherwise, our default behavior is to let cpptools decide. If the target is being sent on the command line though, cpptools may be able to make the decision for us. I'll talk to @Colengms about it.