John Smith
John Smith

Reputation: 787

How to replace construction variables without executing the action in SCons?

I have the following action:

act = SCons.Action.Action('$ACTIONVAR', 'Executing a dummy action')
env['EXTENSION'] = '.err'
env['ACTIONVAR'] = '${SOURCE.filebase}$EXTENSION'

I want to have the value of action var depending on different target and sources. What I want to achieve could be similar to this:

obj = env.Execute(act('file.o', 'file.c'))
print 'Str: ' + str(obj) #this should print 'file.err'

Is it possible to get the value without executing the action ?

Upvotes: 0

Views: 158

Answers (1)

dirkbaechle
dirkbaechle

Reputation: 4052

You are searching for the env.subst() method. Please check the MAN page for a description of its exact syntax and functionality.

Upvotes: 1

Related Questions