Author Topic: active target setting  (Read 9730 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
active target setting
« on: November 27, 2005, 03:49:38 pm »
Before I submit a change request, I'd like to have some feedback first.

I just noticed that the active target is stored in the cbp file.
Typically I would say the cbp file is also put together with the sources in a version control system.
Say your project has several targets working on the same code (debug build, release build ,maybe a special build with some more logging code turned on).

Now when you switch say from your debug target to your release target and you close the project, CB asks you to save the changes you made.
Yes, you made changes to the project, namely that active target (which changed from debug to release in the example) will be stored in the cbp file. So that means, when working with a version control system, you need to check it out, and later check it in, and later the same story when switching back to your debug target and so on ...

My suggestion is (open for discussion from this point on) :
  - don't store the active target in the cbp file
  - store it maybe in the layout file, whick keeps track of the open files in your project (editors) and where the cursor is in those editors , or some other file with a similar purporse ...

What do you think ?

Cheers,
Lieven

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: active target setting
« Reply #1 on: November 27, 2005, 04:23:38 pm »
Yes, go for it!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: active target setting
« Reply #2 on: November 27, 2005, 04:52:55 pm »
What do you think ?
I think it also has some drawbacks:
Everything to repeat the compilation of a project is currently in the project file. Thus, you provide somebody with this file and he will be able to compile exactly as you did.
What do you do with the second layout file? With your proposed changes it has vital information stored in it because the target selection might be important to successfully compile a project. So it should belong to the project sources and therefore to CVS. Thus you have the same CVS problem but on a differrent file.
I for myself update the project files in CVS only, if I really changed something (added/removed files, changed configuration...). If only the target has changed and this change is not vital I don't commit the project file.

I wonder where and how MS VisualStudio stores the current configuration...?!

Morten.
« Last Edit: November 27, 2005, 04:56:20 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: active target setting
« Reply #3 on: November 27, 2005, 05:04:23 pm »
Definetely not in the project file (vcproj), I think it stores it in the ncb or suo files, which are unreadable :-(

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: active target setting
« Reply #4 on: November 27, 2005, 05:11:37 pm »
What do you do with the second layout file? With your proposed changes it has vital information stored in it because the target selection might be important to successfully compile a project. So it should belong to the project sources and therefore to CVS. Thus you have the same CVS problem but on a differrent file.

No, don't add it to version control, since when you turn off CB (or pc) the next day you want to continue with for example your release build, but in the version control system it was stored as debug build, you have to switch again. I think if this settings make it in a file which is in a version control system, the version tree for that file would quickly become very big, especially when there are several developers.
What if you say, ok should always be debug, during development you are for some reason in the release target, then you change another setting of the project, you store the cbp. Woops, next to the 'real adjusted' setting also the active target slipped into the saved version which is handed back to the version control system.
I guess ...


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: active target setting
« Reply #5 on: November 27, 2005, 05:15:58 pm »
I think it stores it in the ncb or suo files, which are unreadable :-(
These files are usually not provided with project sources. So selecting the target seems to be up to the develper who wants to compile the project.Thus the IDE provides the "intelligence" via the target selection mechanism. If you think of "Release/Debug" as targets or similar meanings then this makes sense (on second thoughts)...

...which was a very long sentense for: I agree. :P

Morten.
« Last Edit: November 27, 2005, 05:18:24 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: active target setting
« Reply #6 on: December 07, 2005, 01:49:40 pm »
I noticed that Yiannis recently implemented this. Thanks.
But it seems there might be a little ptoblem.
It is stored in the layout file like this :
<CodeBlocks_layout_file>
    <ActiveTarget index="0" />
</CodeBlocks_layout_file>

index starts from 0.

But when you change it , the layout gets updated, so that's ok.
Now close the poject and reopen it, and take a look at the target selection drop down list at the toolbars.
In my case that one always is on all.
Should that not be in sync with the value from the layout file ??

Cheers,
Lieven

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: active target setting
« Reply #7 on: December 07, 2005, 02:46:42 pm »
Thanks Lieven, just fixed it (rev. 1467).
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: active target setting
« Reply #8 on: December 07, 2005, 03:51:28 pm »
juist build and tested.
I can confirm it works now.


consider this thread as closed.