Code::Blocks Forums
User forums => Using Code::Blocks => Topic started 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.
-
By prepending NAME with a dollar sign and defining its value in the project options.
-
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
-
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.
-
I'm using the Jul 12 2006 nightly build.
I also tried to fix the value at the project level but nothing changed.
-
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.
-
With tonight's release, you should be able to use per-compiler variables again, too.
-
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?
-
Nobody can explain me the exact procedure?
-
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.
-
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.