-
Notifications
You must be signed in to change notification settings - Fork 460
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
Error building cmake project under vscode: Invalid platform #222
Comments
There is a typo in regex which parses generator name to extract platform To work around I suggest changing generator to something like (i.e. move Win64 from generator name to separate setting):
|
This resolved my problem, thanks so much for the help! Closing issue ... |
Um, I'm still having some issues with the updates to the cmake tools. If I build manually with the following commands, then the build is successful:
However, the build fails with compiler errors (perhaps dealing with precompiled headers, I'm unsure) if I select the "Debug" configuration, the "mesos-tests" project, and then click build. This used to work (although I wasn't keeping up to date for a while on the cmake tools), but it's not with the latest plugin. Any idea what might be going on? What do the plugin do that's different than from how I'm building? Thanks, in advance, for any advice. |
Is it failing with the same error that you mentioned above? |
Sorry for not being clear. No, the error is different now. The cmake configuration is now read and loaded (which was not happening before you suggested configuration changes) when I select the "Debug" built type. But now the built itself (clicking the "Build" button) is failing with errors like:
These errors, at very quick glance, are the type of errors that we get from precompiled header problems. BUT: What's interesting here is that if I build via the command line (using the commands I specified above invoking So, this begs the question: What is the CMake Tools plugin doing differently to build than the "direct" cmake build command:
If I build via the above command, all is well. But if I click the "Build" button in VS Code, the build fails. Thanks for your help, and sorry I wasn't clear before. |
Any update on this problem, by chance? Thanks in advance ... |
@jeffaco, I'm so sorry to leave this up in the air. Been busy with "real life" things, which is a common theme in this repo... Hmm... I'm looking to do some refactors that should help with issues like this. I'll try and catch this one on the way through. I'm thinking it may be related to environment variables. What version of CMake are you using? |
@vector-of-bool I'm currently running cmake version 3.9.0. If version of cmake is a contributing factor, I can run any version >= 3.7.0. My project has a dependency on cmake version 3.7.0 or later. Thanks for your help! |
@jeffaco, I know it has been a while, but the recent 0.11.0-beta5 release changes some things about loading the Visual Studio toolsets. Would you be willing to take a look and report back? |
I have the same issue when trying to build with x86 toolset |
Sorry, I'm really at a loss on this one. Anyone reading this: Help! |
For anyone else that's running into this issue, I was able to resolve this by configuring the generator in the workspace instead of the kit: // cmake-tools.json
{
"name": "VS2017 CUDA Support",
"visualStudio": "34360ca7",
"visualStudioArchitecture": "x86_amd64",
"preferredGenerator": {
"name": "Visual Studio 15 2017",
"platform": "x64",
"toolset": "version=14.13"
},
"toolchainFile": "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
}, the // settings.json (workspace settings)
{
"cmake.generator": "Visual Studio 15 2017",
"cmake.toolset": "version=14.13",
"cmake.platform": "x64"
} Based on a really brief dive into the source code, it looks like the workspace settings take precedence here, so if you're specifying the generator in your workspace, all other generator settings from the kit will be overridden. I'm seeing that in driver.ts#L478 For anyone trying to debug this issue, I'd recommend enabling the cmake server protocol debug messages. You can do this by editing @vector-of-bool what do you think about adding a setting to enable or disable this? I find having this enabled gives me a much better diagnosis of where things are going wrong in the CMake server setup process. Happy to start on a PR if you're in agreement here. |
@jclay sorry for the delay here. I've had a lot on my plate recently. Any setting to enable more troubleshooting is a welcome addition! I'd gladly accept a PR. |
This issue has been closed automatically because it needs more information and has not had recent activity. |
I'm having a problem that I don't understand. In VS Code, I used to be able to click "CMake: No Project: Debug: Configuring", select "Debug", and then a cmake file would be built. I could then click the "build" button and build away.
This stopped working when I returned from vacation. There was an update of VS Code itself (I'm running version 1.14.2 of VS Code) and of the CMake Tools extension (running version 0.10.2), and when I now try to build the CMake file, I get:
If I run the cmake command manually, it works. The command I use to run cmake manually is:
Any idea why I'm getting this error? Any help would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: