-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake Tools doesn't send --target to C/C++ tools #1896
Comments
@thunderstorm010, this could be the same as #1879. We are almost done with a fix for that and once it's merged in, we will send you a vsix to install and try. If that will not solve your scenario then we will investigate further. I am not closing this report now, nor marking it as a duplicate yet, until we verify this hypothesis with the upcoming vsix. |
Hi @thunderstorm010 . Would you be able to provide a simplified repro that we might use to validate a potential fix? Perhaps a minimal project configured with the same target, using the same toolset, as a github repo, with setup instructions? |
@thunderstorm010, can you try the CMake Tools vsix from here and confirm if it solves anything for you? |
@thunderstorm010 When you build with CMake, it should generate 'target' files under a |
@yuxinyuan, there is no .cmake/api/v1 path under the build directory not even after you have a successful configure? |
@andreeis @yuxinyuan that path is created when you have cmake version 3.15 and newer as well as the |
@andreeis @bobbrow I was using cmake version 3.10. After upgrading to version 3.18, I can now see the .cmake/api/v1 path. However, there is still no "target" field in the generated files. It seems to me that the extension has parsed --sysroot option from the compile commands, but fail to parse --target option. https://github.com/yuxinyuan/test-cmake-target |
@andreeis I've spent some time on this and I'm able to find a work around for this issue. First, I think the issue happened because of the following. If I inspect my compile_commands.json generated by cmake, I see something like:
Somehow, c/c++ tools needs the --target option to correctly configure intellisense. However, the cache (or whatever) generated by cmake will not contain the --target option (I guess this has little to do with the cmake tools extension). Hence, the issue happened What I do as a work around now is to add the following in my CMakeLists.txt:
This will not hurt the actual compilation and it can also let the --target option be passed to c/c+ tools. The Hope this would help. |
I typed up a new issue for the same problem before I came upon this bug. I thought the details might help, so here the info that I typed up: Brief Issue SummaryIf have issues getting intellisense working when building for an RiscV embedded system. This happens as soon as
cmake will correctly use
Which fail because I found the kind of similar issue #637, but that looks like cpptools/cmake-tools were using a different model of interaction back then. CMake Tools Diagnostics
Debug Log
CMake toolchain replyContent of `.build/.cmake/reply/toolchains-v1....json`
Reply for ROM target
Reply for cache
|
@andreasWallner, thank you for sharing these logs. What appears to be the problem is that the I would think that this is a CMake bug (everything required on the command line should be in the fragments**), but we could probably poke around the toolchain object model and try to grab it from there. **EDIT: I guess |
@bobbrow Not sure it's cmake's "fault", they are at least consistent with their documentation (even though I have to admit it seems a bit inconsistent). I don't really have a stake in either tool though... |
We have a fix for this. It should be in the 1.13.17 release tomorrow morning (PDT). |
See microsoft/vscode-cpptools#7519 for more info.
TL;DR
The text was updated successfully, but these errors were encountered: