Community
Participate
Working Groups
'Rebuild Last Target' is a very interesting feature. It would be even greater if we could call it during the edition of a file : it would rebuild the last target of the first englobing directory/element with an associated target. I have several directories, each of them representing a library. When I edit a file my next action is always to build a target of the containing directory. Having to select the directory in another view (i.e., 'C/C++ Project view') is quite annoying. Filling this demand I just realized that it is already the case in the C/C++ Project view. Same idea could apply for 'Build Target'. Having the same key mapping would be great
Hmm, it is supposed to work from editor. Looks like there is a bug there and F9 in editor is not activated after starting of eclipse. If you run F9 from C/C++ Project view it then starts working from editor as well.
Ha, interesting, I completely missed that! In fact it works as you describe but only for direct child file of a directory. I use the following structure : Module/ file1.h Implementation/ file1.cpp Tests test_file1.h test_file1.cpp And I have only set targets for 'Module' directory. So when pressing F9 in file1.h : ok, launches the latest Module target. And when pressing F9 in file1.cpp : it opens the Build Target menu for Implementation, which is empty. Same for other files. So, Ok, my structure is a bit unusual, except, maybe, for Test sub-directory. My wish is to launch the first available target by getting recursively up, i.e., skipping directories that have no associated build targets until we get one, and if none, existing behaviour.
There is also a preference to use make target from project root, see Preferences->C/C++->Build->Make Targets - Rebuild Last Target "from project root". You can try that as an option.
Thanks for pointing out this option. It is still not satisfactory because my projects have several modules, so I would need to select the appropriate build target whereas this target is implicitly defined by the current opened file. I still wish to be able to rebuild the last target by searching recursively up, for example as a third option in Preferences->C/C++->Build->Make Targets - Rebuild Last Target, which would do no harm.
(In reply to comment #4) > Thanks for pointing out this option. > > It is still not satisfactory because my projects have several modules, so I > would need to select the appropriate build target whereas this target is > implicitly defined by the current opened file. > > I still wish to be able to rebuild the last target by searching recursively up, > for example as a third option in Preferences->C/C++->Build->Make Targets - > Rebuild Last Target, which would do no harm. In bug #333113 I added to Rebuild Last Target an option so that it will use the actual last target of the current project irrespective of the currently selected resource. Would this option help you?