Author Topic: Variable pluggins  (Read 6670 times)

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Variable pluggins
« on: June 10, 2007, 10:40:56 pm »
I was wondering what the difference is and how they effect the C::B and compiling.  What is best placed in where?

1. Environment Variables plugin http://wiki.codeblocks.org/index.php?title=Environment_Variables_plugin

2. Custom Variables under Global Compiler

3. Custom Variables under Project Build Options.  For this one, would Debug (or What ever build is selected) override the root options (at the root of the tree)?  Also, if nothing is set in the specific builds (like Debug) are the root options applied?

    Obviously, options specific to this project go here.  Would these options override #2 and #1?

4. Where does Global variables fall in this order of precedence?

Hopefully, I have explained what I am looking for enough for people to understand.  In short what order of precedence are the variables treated and looked up?  For example where is the best place to put the WX_SUFFIX definition?

jmccay
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Variable pluggins
« Reply #1 on: June 11, 2007, 04:35:03 am »
Good questions that I don't know the answers to, but you do know that "Environment Variables" and "Custom Variables" are two different things, right?

Based on my understanding, Environment Variables are Operating system Variables.
Under windows see the "SET" command; Under Linux see "export" command.

Custom Variables are internal to Code::Blocks.

4. Where does Global variables fall in this order of precedence?

Global variables all start with # symbol so there is no order of precedence issue.

Tim S
« Last Edit: June 11, 2007, 04:43:10 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Variable pluggins
« Reply #2 on: June 11, 2007, 08:11:24 am »
1. Environment Variables plugin
These are system wide and can be set/overridden by the envvars plugin. It's helpful if your e.g. have another build systems besides C::B that uses envvars (like Makefiles). This way you can "share" this technology.

2. Custom Variables under Global Compiler
These are helpful to e.g. quickly change a path for a compiler suite. For example: You have gcc 4.2.0 and gcc 3.4.5 installed. The all have the same path structure so if you setup the main path to the executables as e.g "D:\Devel\GCC$(GCC_VER)" and additional include/lib "D:\Devel\GCC$(GCC_VER)\include"/"D:\Devel\GCC$(GCC_VER)\lib" folders as you can easily switch between both compilers by just changing the custom variable. This would (of course) apply to *all* projects that use GCC.

3. Custom Variables under Project Build Options.
These are very helpful if you want to compile your project against two compiler as stated above. You can have two targets with different compilers. In addition you can (as you have stated already) easily append a "d" to libs for the debug version, w.g. wxmswud. The values are being overridden in the order of details - compiler custom variables are overridden by project CV's and project CV's are overridden by target CV's. It only makes sense that way... btw...

4. Where does Global variables fall in this order of precedence?
These variables have a very special meaning. In contrast to all others if you setup such a variables and share your project file with others that have *not* setup this GV C::B will ask the user to setup the variable. This is a very easy way to ensure the "other developer" knows what to setup easily. C::B will ask for all path's usually necessary.

For example where is the best place to put the WX_SUFFIX definition?
There is no best place. It really depends on your development habit. If you prefer release/debug targets, put it in the target CV's. If you prefer release/debug projects, put it in the project CV's. If you only use debug versions put it in the compiler CV's. Just exactly this way that reduces maintenance for you.

With regards, Morten.
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 dje

  • Lives here!
  • ****
  • Posts: 683
Re: Variable pluggins
« Reply #3 on: June 11, 2007, 08:23:29 am »
Hi Morten !

Thanks for these precisions, it makes things very clear !
Do you plan to put it on the wiki ?

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Variable pluggins
« Reply #4 on: June 11, 2007, 09:31:44 am »
Do you plan to put it on the wiki ?
No, I don't have time ATM. But if you want to - feel free to do it yourself - it's an open WiKi. It surely would have need to be cleaned up a little and take this into consideration:
http://wiki.codeblocks.org/index.php?title=Global_compiler_variables
(I would be glad if you find the time to contribute...)
With regards, Morten.
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 dje

  • Lives here!
  • ****
  • Posts: 683
Re: Variable pluggins
« Reply #5 on: June 11, 2007, 10:02:46 am »
I'll create the page tonight and cross reference both pages (new and http://wiki.codeblocks.org/index.php?title=Global_compiler_variables).
I won't change the content because yours is very clear and I did not play a lot with variables.

Dje

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Variable pluggins
« Reply #6 on: June 11, 2007, 11:01:09 pm »
Hi !

The page has been created here.
It is referenced in user documentation here.

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Variable pluggins
« Reply #7 on: June 12, 2007, 10:26:01 am »
The page has been created here.
It is referenced in user documentation here.
Great. Nice contribution,... thanks! :-)
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 dje

  • Lives here!
  • ****
  • Posts: 683
Re: Variable pluggins
« Reply #8 on: June 12, 2007, 02:15:48 pm »
Quote
Great. Nice contribution,... thanks!
You're autocongratulating  :lol:

The harder thing was just to learn how to create a new page in a wiki (I am not an expert in Wiki), otherwise it was just a copy/paste...

Dje