Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Jabber on March 21, 2006, 11:08:30 pm

Title: Custom build commands and variables
Post by: Jabber on March 21, 2006, 11:08:30 pm
Hi all,

I'm trying to add compilation support for a SWIG interface file (generating a Lua wrapper); to do so I added the following line in Options(for the .i file)->Build:
Code
swig -c++ -lua $FILENAME

However, it seems that the variables like $FILENAME don't get substituted, the build log just says
Quote
swig -c++ -lua
(that call fails, of course).

I'm using the SVN rev 2218 on Windows XP; it looks like someone had a similiar problem a while back:
http://forums.codeblocks.org/index.php?topic=1485.msg10583#msg10583 (http://forums.codeblocks.org/index.php?topic=1485.msg10583#msg10583).

Am I doing something wrong or is this a bug?

Thanks,

Jabber
Title: Re: Custom build commands and variables
Post by: takeshimiya on March 21, 2006, 11:16:24 pm
Hi all,

I'm trying to add compilation support for a SWIG interface file (generating a Lua wrapper); to do so I added the following line in Options(for the .i file)->Build:
Code
swig -c++ -lua $FILENAME

However, it seems that the variables like $FILENAME don't get substituted, the build log just says
Quote
swig -c++ -lua
(that call fails, of course).

I'm using the SVN rev 2218 on Windows XP; it looks like someone had a similiar problem a while back:
http://forums.codeblocks.org/index.php?topic=1485.msg10583#msg10583 (http://forums.codeblocks.org/index.php?topic=1485.msg10583#msg10583).

Am I doing something wrong or is this a bug?

Thanks,

Jabber


AFAIK, only variables in the form $(variable) or ${variable} are expanded.
Title: Re: Custom build commands and variables
Post by: Jabber on March 21, 2006, 11:19:59 pm
Hi,

AFAIK, only variables in the form $(variable) or ${variable} are expanded.

Yep, tried that too, but both versions don't work neither.
Title: Re: Custom build commands and variables
Post by: thomas on March 21, 2006, 11:21:52 pm
Quote
AFAIK, only variables in the form $(variable) or ${variable} are expanded.
Nope, they should be.

Where is that variable defined? If it is in the compiler's scope ( = global) then it does not work, that's a known bug.
Title: Re: Custom build commands and variables
Post by: Jabber on March 21, 2006, 11:35:22 pm
Hi,

Under Options(for the file)->Build it says
Quote
You can use the following variables:
and then a list of variables like $FILENAME and so on, so I didn't define that variable, but C::B should have ;)
Title: Re: Custom build commands and variables
Post by: thomas on March 21, 2006, 11:51:24 pm
But... $FILENAME is not a valid builtin (unless I am very mistaken).

Which file's name is it supposed to be (probably some header)?


EDIT: Aaaaaah.... now I see what you mean. Hmm... got no quick answer ready for that now, sorry. It appears that you are doing as you should.
Title: Re: Custom build commands and variables
Post by: Jabber on March 22, 2006, 12:02:29 am
Well, I was just preparing an answer when I saw your edit ;)

Is this a bug then, or can anyone else confirm that it is working for him?
Title: Re: Custom build commands and variables
Post by: Jabber on March 23, 2006, 12:44:23 am
Just as a short follow-up:

This is fixed in the 22.03.06 build at http://forums.codeblocks.org/index.php?topic=2690.0 (http://forums.codeblocks.org/index.php?topic=2690.0).
The correct variable is "$file".

A big thank you to the devs!