Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Make Target View "Use default" checkbox in build command does not behave as expected

Hi all,

I created a C/C++ project.
I am using Make Targets for the build. Following is the observation.

let us assume there there is a Make Target created with default settings.
Default settings are as follows :
Project Properties -> C/C++ Build -> Builder Settings has "Use default
command" checkbox enabled. And so Build is supposed to use default command
defined for the builder.
Make Target created takes these default settings has "Use default command"
checkbox enabled and so when build is done, it uses the default command for
particular target.

Now , with the following steps done, observation is as follows :

1. Right click on Project Name in Explorer, Go To Properties -> C/C++Build
-> Builder Settings. Uncheck the "use default command" checkbox. Update the
build command to "/bin/ls". This gets updated in .project file
Now, go to your created Make target. Double click on it or Right Click ->
Build make target. And it now executes "/bin/ls". Make Targets are stored
in .cproject file.

2. Right Click on make target -> Edit Make Target, Uncheck the default use
command box. Enter the build command as /bin/pwd. Update it. And now it
runs as the "/bin/pwd". This command gets updated in .cproject file also.

3. Go to Project Properties -> C/C++ Build-> Builder Settings. And again
enable the checkbox to use default build command.
Now go to make target, Edit Make Target, Enable checkbox to use default
build command and now it again executes the default build command taken
from .project.

So, it seems that whenever the "Use default command" checkbox is enabled ,
it reads from .project file i.e. Project Properties settings.
And whenever checkbox is not enabled, it reads directly from .cproject
<buildTargets> tag.

And thus, for Make Target , "Use default command" means to use whatever is
defined in Project Properties irrespectiv of "use default command" is true
or false in project properties. And does not use always the default command
as defined in builder extension in Plugin.xml file.

Is it a bug ? or is it how the CDT Make Target is designed to work
intentionally. And if so why is it defined like this ?

And if so then isn't the Checkbox in Make Target should be labelled as "Use
build command from Project Properties"

I have seen this behaviour while using Eclipse CDT 4. Then I also checked
it in CDT 5. And it still behaves the same way.

Thanks & Regards,
    - Nayna Jain

Back to the top