-
Notifications
You must be signed in to change notification settings - Fork 468
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
--target
argument missing from CppTools custom configuration args
#2800
Comments
Hi @zuowanbushiwo . When you use It looks like CMake Tools is providing a
Are you able to compile the file that you are repro'ing the issue with? If so, CMake would seem to be aware of the include paths it requires, and the issue may be with CMake Tools failing to provide that information to the C/C++ Extension. |
@Colengms Befoe configure: C/C++ Log Diagnostics:
CMake Diagnostics:
configure log:
After configure: C/C++ Log Diagnostics:
CMake Diagnostics:
Build log:
.vs_code/c_cpp_properties.json:
.vscode/settings.json
|
@Colengms |
Hi @zuowanbushiwo . Could you provide the output from the C/C++ output channel, from the full repro scenario? It does look like CMake Tools is correctly providing a |
@Colengms
|
Hi @zuowanbushiwo . The command cpptools used to query the compiler was:
... Which includes the sysroot arg. However, the compiler only returned the following system include path:
Normally, clang will return any system includes it will use related to the sysroot that was passed to it. I tried installing android-ndk-r25b. When I run the query command line, I get the following:
But, those do not include the paths you had specified in your base configuration. I'm assuming these are needed? :
Normally, if you can successfully compile using CMake Tools, cpptools should receive the same information, and there should be no issue. But, for some reason, cpptools does not appear to have sufficient information to invoke the compiler and receive the additional sysroot include paths you are expected. Maybe there is some information that was not provided to cpptools from CMake Tools. Or perhaps there is some dependency on the current working directory being set to a specific directory. Or, perhaps some environment variable is expected to be set. Could you provide a verbose output from CMake Tools from building your project, with the following setting enabled?
That should ensure full command lines are included in the build log. If that build log is excessively large, I'd only need to see up until the first compile command line. |
Hi @Colengms I added the changes in setting.json, but I don't know where the log you want is? Is it the attachment below?
Build log
C/C++ log: CMakeOutput.log: in mine
|
I downloaded from the same location. What appears to be different from yours? My results match your logs. Based on the information you've provided, I built my own project and it looks like CMake Tools is failing to provide the
resuling in this compiler query command line:
And here is an actual command line it used to compile a file:
If I add the
Moving this issue to the vscode-cmake-tools repo. |
--target
argument missing from CppTools custom configuration args
Does your CMakeCache.txt have a value for |
Actually, no that's not what we want. I think we can grab the information from the toolchain json file. I'll put this issue on deck and see if we can get a fix out sooner. |
I didn't have a workspace I could test this on, but it looked like the information was already available and just needed to be hooked up. If you would like to try this version of the extension and let me know if it sends the
|
Hi @bobbrow @Colengms C/C++ log:
|
"cmtVersion": "1.13.0-8fc50eb"
|
Thanks for testing it. It looks like the target is being added twice. I'll see if I can see what's going on with that. |
I found the issue. I'll get it committed today and then the fix will be in the official pre-release tomorrow morning. |
We have a fix for this. It should be in the 1.13.17 release tomorrow morning (PDT). |
Environment
c_cpp_properties.json:
CMakeLists.txt:
Error image:

If I don't compile, just browse and write code, everything is normal: no red under lines and can automatically complete code and ctrl+click include files can jump to the correct file。
when I compiled, it can compile and output the correct target, but there will be a problem with the picture above:system includes aren't included.
Error log:
How to fix?
Bug Summary and Steps to Reproduce
Bug Summary:
Steps to reproduce:
Expected behavior
No response
Code sample and Logs
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: