Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Changing build options, should force a rebuild

(1/8) > >>

iw2nhl:
Hi,
I noticed that changing build options (Project -> Build options) and building (Build -> Build), the compiler says:
--------------
Target is up to date.
Nothing to be done.
--------------
But, in fact, it should recompile everything!
I tried to set some compiler and linker options and they are not applied until I force a rebuild (Build -> Rebuild).
Can this considered a bug?

Moreover, if I change something in a file and I select different compile options, only the changed file is compiled with new options and then it is linked with other files that where compiled with different options?
Isn't this dangerous?
May be there are different ways of passing arguments to functions because of different options and this should cause a crash.

May be also that I'm wrong!

tiwag:
i think you are right :)

sethjackson:
Yea I think you are right too. :)

MortenMacFly:

--- Quote from: iw2nhl on July 18, 2006, 02:33:41 pm ---Can this considered a bug?

--- End quote ---
I don't think so. You are changing global settings for your project and expect that C::B shall know to re-build. Well for this C::B should be able to really know (!) what compiler option(s) require a re-build, or only re-link etc. Think about you change the directory for includes. for this C::B should be able to know what header files your project includes, if they have changed do a re-build. This way you can find many things C::B should check to see if a re-build is required or not. But why let C::B do this calculation? This is definetely error-prone. If you as developer know you've changed compiler options you also know if you have to do a re-build or not. Thus if you just press "build" IMHO you are doing wrong.
Also think about that C::B supports a wide range of compilers. Are you really willing to implement for each compiler what switches require a re-link / re-build or change nothing? If a new compiler version comes out you have to reconsider everything.
IMHO a IDE shall be clever but not too clever. To fulfil such cleverness you are expecting here cannot be implemented on a safe basis. Thus it isn't.

With regards, Morten.

BTW: If you ahve ever worked with Makefiles: If you change the CFLAG inside the makefile does this re-build your sources? Is this a bug in Make? ;-)

iw2nhl:

--- Quote from: MortenMacFly on July 18, 2006, 03:12:29 pm ---I don't think so. You are changing global settings for your project and expect that C::B shall know to re-build. Well for this C::B should be able to really know (!) what compiler option(s) require a re-build, or only re-link etc. Think about you change the directory for includes. for this C::B should be able to know what header files your project includes, if they have changed do a re-build.

--- End quote ---
I know this problem, but there is a very simple solution: if something has been changed in the compiler options since last build, mark all files as dirty (and this can be done in several ways). So you are forced to recompile everything. You can also show a messagebox informing the developer of the forced full-rebuild when "rebuild" is clicked (if there are pending changes).
This is what is done by other IDEs (e.g.: VS6).

--- Quote from: MortenMacFly on July 18, 2006, 03:12:29 pm ---BTW: If you ahve ever worked with Makefiles: If you change the CFLAG inside the makefile does this re-build your sources? Is this a bug in Make? ;-)

--- End quote ---
Yes, for my point of view this is a bug.
The same for .h files: if you change only .h files (I if remember well), nothing is recompiled and for me this is a bug of the make tool.

Best regards,
Alessandro

Navigation

[0] Message Index

[#] Next page

Go to full version