Author Topic: Custom build commands and variables  (Read 5585 times)

Jabber

  • Guest
Custom build commands and variables
« 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.

Am I doing something wrong or is this a bug?

Thanks,

Jabber

takeshimiya

  • Guest
Re: Custom build commands and variables
« Reply #1 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.

Am I doing something wrong or is this a bug?

Thanks,

Jabber


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

Jabber

  • Guest
Re: Custom build commands and variables
« Reply #2 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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Custom build commands and variables
« Reply #3 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Jabber

  • Guest
Re: Custom build commands and variables
« Reply #4 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 ;)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Custom build commands and variables
« Reply #5 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.
« Last Edit: March 22, 2006, 12:00:21 am by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Jabber

  • Guest
Re: Custom build commands and variables
« Reply #6 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?

Jabber

  • Guest
Re: Custom build commands and variables
« Reply #7 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.
The correct variable is "$file".

A big thank you to the devs!