Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331664

Summary: Build only the actual target to run
Product: [Tools] CDT Reporter: Miklós Espák <espakm>
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: enhancement    
Priority: P3 CC: aegges, cdtdoug, espakm, yevshif
Version: 7.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Miklós Espák CLA 2010-12-02 08:43:16 EST
Build Identifier: 20100917-0705

It would be nice to have an option in the "Run configuration" dialog, to build only the actual target to run.

E.g. if you want to run the target "test1", it would be enough to execute "make test1" not "make all".

Now, in the Run configuration dialog a build configuration can be selected, or the build can be disabled. However, the default build builds the whole project. If you modify a class that many targets depend on, all of these targets will be built what can take rather long time. (Especially if it is a template class.)

One workaround is to create a build configuration for every runnable target, and to choose these in the run configuration dialogs.

Another possibility is to disable the build before run, create a target in the Make target view, and build the target always by hand before running it.

It would be enough to assign the name of the last built target or
(even better) the name of the target to run, to a variable. Then, you
could create a build configuration that refers to that variable, and
use that build configuration from the run configurations.

Reproducible: Always

Steps to Reproduce:
1. Create a run configuration, and select the binary "test1"
2. Select "Enable auto build"
3. Run it.
The whole project will be built with "make all". (Instead "make test1".)