eclipse-cdt-cloud / cdt-cloud-blueprint

CDT Cloud Blueprint is a template for building custom web-based C/C++ tools. It is made up of existing open source components and can be easily downloaded and installed on all major operating system platforms.
MIT License
25 stars 11 forks source link

Add task to run binary of CMake example #45

Closed planger closed 1 year ago

planger commented 1 year ago

Fixes #44 Contributed on behalf of STMicroelectronics.

What it does

Adds a task that runs the binary (without debugging) to the CMake example.

https://user-images.githubusercontent.com/588090/212020429-04550a69-6226-4907-ad01-2b442666a364.mp4

How to test

planger commented 1 year ago
  1. Is there a reason that it is a task and not a launch config?

Not really, but a launch config always needs a launch type, which typically is associated with an extension that supports launching / debugging a specific type of application. As we just want to run an executable, we could (mis-?)use node-terminal for that. That would work.

    {
        "type":"node-terminal",
        "request": "launch",
        "name": "Launch Example C++",
        "command": "${workspaceFolder}/Example",
        "preLaunchTask": "Binary build"
    }

However, I'm not really seeing a benefit to using this launch config above in comparison to the GDB configuration. It is the same but has less features, i.e. breakpoints won't work. Using a task instead of the launch at least wouldn't imply that breakpoints may work (which they won't with the launch config above, but would with the GDB launch config). WDYT?

  1. Should we maybe name it consistently with the debug config? "Launch Example C++". Which might imply that we also rename the debug config to something better?

Sure, I'm happy to rename once we settled on whether it is going to become a launch config or remain a task.

JonasHelming commented 1 year ago

1: sounds good! 2: Yes, please go ahead!

planger commented 1 year ago

Thanks, I kept it as a task, but renamed the task to "Launch Example C++".