List Info

Thread: Access to other variables exist in another file.




Access to other variables exist in another file.
user name
2007-10-15 19:23:56
Hello~!
 
I made two different files, Jamroot and rules.jam in the same directory. "rules.jam" has lots of information about building a project. So, "Jamroot" file has to access many variables exist in " rules.jam". Anyway, I used some code below. I palced this code to "rules.jam".
 
# in "rules.jam"
local CFLAGS = -Wall -O2 ... ;
 ;
rule peek ( module-name ? : variables + )
{
  ; module-name $(module-name)
  {
 ;    return $($(>)) ;
 ; }
}
 
And I used it by this code in "Jamroot".
 
# in "Jamfile"
import rules ;
local cflags = [ rules.peek : CFLAGS ] ;
echo $(cflags) ;
 ;
But, it didn't make any outputs. Why..?
 
Does anybody know how to solve it?
 
Thanks in advance.
 
 
 
Young Hyun.
Re: Access to other variables exist in another file.
country flaguser name
Russian Federation
2007-10-16 00:04:33
On Tuesday 16 October 2007 04:23:56 κΉ€μ˜ν˜„ wrote:
> Hello~!
> 
> I made two different files, Jamroot and rules.jam in
the same directory. "
> rules.jam" has lots of information about building
a project. So, "Jamroot"
> file has to access many variables exist in
"rules.jam". Anyway, I used some
> code below. I palced this code to
"rules.jam".
> 
> # in "rules.jam"
> local CFLAGS = -Wall -O2 ... ;
> 
> rule peek ( module-name ? : variables + )
> {
>    module-name $(module-name)
>   {
>      return $($(>)) ;
>   }
> }

This is a rule taking two parameters.

> And I used it by this code in "Jamroot".
> 
> # in "Jamfile"
> import rules ;
> local cflags = [ rules.peek : CFLAGS ] ;

Here's, what are the values you pass for 'module-name'
and 'variables' parameters? I'm pretty sure that
'module-name'
is not 'rules', so I'm not at all surprised this returns
nothing.

   [ rule.peek rules : CFLAGS ] 

might be better, or even better, define 'cflags' *rule* in
your rules module

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )