Author Topic: Adding Compiler  (Read 8589 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Adding Compiler
« on: October 17, 2005, 05:34:37 pm »
When you add a new compiler set, and you specify the compiler, linker, option, regular expressions for warnings/errors,  ...
Where does CB store this information.

Might be useful if you want to 'update' CB with this info on several PC's.

Can this info be imported from a centralized place ?


kidn regards,
Lieven

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Adding Compiler
« Reply #1 on: October 17, 2005, 05:39:28 pm »
killerbot: This info is stored in the codeblocks configuration file. Yes, it's ugly. And yes, we want to change it. We're revamping the framework after version 1.0 is released, to support every possible feature or customization regarding the compiler.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Adding Compiler
« Reply #2 on: October 17, 2005, 06:41:39 pm »
Under windows, just export HKLM\Software\Code::Blocks and import it in all the other computers (or was it HKCU? sorry I don't recall now).
Under other platforms, it's the file "~/.Code::Blocks v.10".
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Adding Compiler
« Reply #3 on: October 17, 2005, 07:08:29 pm »
Under windows, just export HKLM\Software\Code::Blocks and import it in all the other computers (or was it HKCU? sorry I don't recall now).
Under other platforms, it's the file "~/.Code::Blocks v.10".

Wouldn't Settings -> Import/export configuration be the more logical thing to recommend? I thought someone mentioned that works now?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Adding Compiler
« Reply #4 on: October 17, 2005, 07:55:42 pm »
Under windows, just export HKLM\Software\Code::Blocks and import it in all the other computers (or was it HKCU? sorry I don't recall now).
Under other platforms, it's the file "~/.Code::Blocks v.10".

Wouldn't Settings -> Import/export configuration be the more logical thing to recommend? I thought someone mentioned that works now?

You see, the export-part works just fine. The import-part is not implemented because of some technical difficulties  :oops:
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Adding Compiler
« Reply #5 on: October 17, 2005, 08:42:28 pm »
Why is it stored in the registry ? Wouldn't it be better to also store it like the other platforms in a configuration file ??
Dunno, maybe config files can be passed around all over the different platforms, or maybe not ? :-)

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Adding Compiler
« Reply #6 on: October 18, 2005, 09:57:16 am »
Why is it stored in the registry ? Wouldn't it be better to also store it like the other platforms in a configuration file ??
Dunno, maybe config files can be passed around all over the different platforms, or maybe not ? :-)

I think they use the wxWidgets config tools, which have classes for registry, .ini files or unix config files. They have a typedef wxConfig to the 'native' configuration storage, which is wxRegConfig on Windows and wxFileConfig pretty much everywhere else, which is probably what Code::Blocks uses.
Though passing config files around might be nice, some settings are only available/relevant on some platforms. On Windows there is no need for a terminal program to be specified for instance, so moving a config file from Windows to Linux might very well still require some manual editing. Not to mention the fact that filesystem paths (for compilers, include dirs etc.) are best set in a system-dependant way.
And you'd have to check if wxFileConfig can handle non-native line endings, I'm not sure about that one.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Adding Compiler
« Reply #7 on: October 19, 2005, 02:42:54 pm »
it's HKCU.

Just a litlle remark, if you look at the projects file, the compiler is specified in there.

I have added for example a new compiler set (WindRiver compiler). It works nicely thanks to the really great framework offered by CB. In the project files a project for this compiler get's as compiler specification :
<Option compiler="5"/>
So it starts counting from 0, since there are already 5 preregistered compilers to CB. So this is the 6th compiler.
In the registry I can find compiler_sets : 001, 002, 003, 004, 005, 256. A little surprising : over there it is known as 256 ??

Getting to the remark, would it not be better that a compiler set can (?also?) be specified by a string , instead of by a number.
Just a few arguments pro : when you work with several people on the same project and you are using a version control system, it is no surprise that the project file is in the version control system (another reason why everything should be specified with relative paths). On the other hand, some collegue might be working with other compilers also, and might have imported them into CB. So for guy 1, there might be a compiler '6' '7', ..., while for guy 2 there are '6' '7' '8'. The problem is here to have guy 1 '6' to be the same one as guy 2 '6'. This is rather difficult although possible, but keeping humans in sync ...
And what if next month CB comes with 6 supported compilers out of the box, what will happen with the current 6th one ?


This burden can be a bit easier if we specify a compiler by name, then the order in which the compiler were added is of less importance, people just have to make sure they use the same name.

So in the project file, we might find something like :
<Option compiler="gnu3.4.2"/>
<Option compiler="WindRiver"/>
<Option compiler="DigitalMars"/>
...

For this reason it would also be interesting that the compiler settings could be imported from a file, which makes installation on several machines easier.

I know, I know, too many requests, but hey CB kicks ass, let's just kick harder. :-)


kind regards,
Lieven

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Adding Compiler
« Reply #8 on: October 19, 2005, 03:18:07 pm »
Thanks for the comments, Lieven.
Maybe you 've read that in other forums, we 're planning a compiler framework re-design post-1.0 to address these issues (and more). Discussion will start at some point after RC2 is released so make sure you participate ;)
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Adding Compiler
« Reply #9 on: October 19, 2005, 05:13:36 pm »
Count me in !

By the way, are those last nasty bugs crushed that block RC2 ??

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Adding Compiler
« Reply #10 on: October 20, 2005, 08:28:53 pm »
Count me in !

By the way, are those last nasty bugs crushed that block RC2 ??

We're trying to, but they're very tricky :P. But I think we found the nest. It's all matter of trying out the insecticide that Thomas posted today, and see if it killed them.