Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Devil_Advocate on July 17, 2006, 09:33:31 am

Title: GNU ARM GCC
Post by: Devil_Advocate on July 17, 2006, 09:33:31 am
I want to use GNU ARM GCC compiler and I need to use some flags. How can I replace NAME by a custom value ? for example I want to replace -mcpu=NAME by -mcpu=arm920t.
Title: Re: GNU ARM GCC
Post by: thomas on July 17, 2006, 09:46:57 am
By prepending NAME with a dollar sign and defining its value in the project options.
Title: Re: GNU ARM GCC
Post by: Devil_Advocate on July 17, 2006, 09:55:37 am
I go to Settings->Compiler and debugger->Custom variables and add a new variable NAME with the arm920t value but it does'nt change anything
Title: Re: GNU ARM GCC
Post by: thomas on July 17, 2006, 10:10:25 am
That's possible. In some versions, the per-compiler variable settings are not honoured. It is why I told you to set the variable at project level (which you did not do).
Since you weren't telling what version you use, it is kind of hard to tell more. If you use a reasonably recent build, you could use a global compiler variable, which would offer more flexibility, too.
Title: Re: GNU ARM GCC
Post by: Devil_Advocate on July 17, 2006, 10:16:39 am
I'm using the Jul 12 2006 nightly build.
I also tried to fix the value at the project level but nothing changed.
Title: Re: GNU ARM GCC
Post by: thomas on July 17, 2006, 10:34:26 am
In the 12 July build, project-level variables certainly work (I use those every day), however, the ones you set compiler-wide are not honoured.
This is not a big problem in your case, though, as the 12 July build supports GCV. Go to Settings -> Global Variables and define your variable there. In fact, this is even better because you can have different sets, so for example switching to another compiler version is very easy.

Remember that you have to reference that type of variables by $#NAME or $(#NAME), not $NAME. See the WiKi ("global compiler variables") for more info on that subject.
Title: Re: GNU ARM GCC
Post by: thomas on July 17, 2006, 11:00:05 am
With tonight's release, you should be able to use per-compiler variables again, too.
Title: Re: GNU ARM GCC
Post by: Devil_Advocate on July 18, 2006, 08:44:45 am
I tried with the 17 July nightly build but I didn't manage to replace NAME by a custom value. Can you send me screen-shot please?
Title: Re: GNU ARM GCC
Post by: Devil_Advocate on July 21, 2006, 09:06:03 am
Nobody can explain me the exact procedure?
Title: Re: GNU ARM GCC
Post by: MortenMacFly on July 21, 2006, 09:14:08 am
You need to use $NAME as compiler option. Then define a custom variable "NAME" with e.g. "arm920t" as content (without quotation marks). I tried it -> it works.
Title: Re: GNU ARM GCC
Post by: MortenMacFly on July 21, 2006, 09:22:43 am
Look here:
(http://img157.imageshack.us/img157/3906/screen1uq2.png) (http://imageshack.us)

...and here:
(http://img146.imageshack.us/img146/7154/screen2xn8.png) (http://imageshack.us)

...and finally here:
(http://img134.imageshack.us/img134/7840/screen3rm3.png) (http://imageshack.us)

With regards, Morten.