vscode-cmake-tools: Unable to debug my test

I am facing a similar issue with one of my cmake projects. I am trying to run this on a remote machine. The host machine is OSX 11.4 (Big Sur). The remote is a Ubuntu 20.04.3. The project configures and builds okay. But I am not able to debug any of my unit tests. This is the error I get when I right-click on the test and press ‘Debug’

[extension] [1484] cmake.debugTarget started [main] Failed to prepare executable target with name 'core-01_hello_test.cpp' [extension] [1484] cmake.debugTarget finished (returned null)

Does not give me any other information.

This is what my cmake command looks like:

"cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja"

I have tried Debug, ‘Debug’, and also ‘DEBUG’. Doesn’t seem to make a difference.

_Originally posted by @CatsNipYummy in https://github.com/microsoft/vscode-cmake-tools/issues/1692#issuecomment-905059538_

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 34 (19 by maintainers)

Most upvoted comments

I’m glad you were able to resolve this. I’ll close this issue, but create a new one for us to investigate whether we can throw in a warning about this type of situation.

Dug around the project a bit and found the source of the issue. We’re forcing the CMAKE_BUILD_TYPE cause of some cross-platform support like you mentioned. That’s something on our end that needs to be changed. But removing that fixed this issue. Thanks a lot for your help @bobbrow . Feel free to close this issue if you like.