Closed mmarczell-graphisoft closed 11 months ago
Hi, @mmarczell-graphisoft . Currently, this would seem to be the intended behavior. The compiler identifies itself as clang, with the wasm32-unknown-emscripten
target type. Unfortunately, that target type is not recognized (not currently a target the C/C++ Extension can configure IntelliSense to support). So, in an effort to auto-configure the extension to use that compiler, it's falling back to the host as the target, which it can successfully configure the compiler to use.
We are working on some improvements to the 'compiler query' implementation, which should eventually address this. In the meanwhile, it may be possible to work around the issue by providing --target=wasm32-unknown-emscripten
as a compilerArg
. Since you're using CMake Tools, that may require use of add_compile_options
. This may continue to use some incorrect IntelliSense settings, such as for sizes of some predefined types. But, it should cause the compiler to be queried using the wasm32-unknown-emscripten
target type, which should correctly resolve system includes and system defines for that target type.
This issue has been closed because it needs more information and has not had recent activity.
Environment
Bug Summary and Steps to Reproduce
Bug Summary: Cpptools sends an incorrect
--target
argument specifying the host platform, when querying the compiler in a cross compilation workflow.Steps to reproduce:
Expected behavior: No errors should be detected in the file.
Configuration and Logs
Other Extensions
CMake Tools
I've found that if I comment out the "configuration provider: cmake tools" line, the error goes away. So I'm not sure if this is a bug in Cpptools or in CMake Tools.
Additional context
The error only manifests on an Apple Silicon based Mac. It works fine on an Intel Mac.
I dug into where Intellisense is getting system include paths from. In the logs I found the following difference. On the Intel Mac, this command line is invoked:
When invoked in a terminal, the output starts with
On the Apple Silicon Mac, the command line becomes
So on the ARM Mac, Cpptools specifies a
--target=aarch64-arm-none-eabi
compiler option, even though this is supposed to be a cross-compilation workflow.