I'm writing a custom Builder. Is there any way from inside the Builder to get the root path of the variant_dir it's building in?
Maybe a property on env?
Or maybe from a target node? For example, if in my Builder I have:
target[0].path --> path_to/my_variant_dir/subdir/target_file.txt
Is there a way to determine which part is the variant_dir path?
'path_to/my_variant_dir'
You specify the variant dir in the call to SConscript() so you can just store it on the env and retrieve it later. Ive actually done this before for a different reason, like this:
var_dir = 'some_dir'
env['variant_dir'] = var_dir
SConscript('subdir/SConscript', variant_dir = env['variant_dir'], duplicate = 0)
...
def yourBuilderFunc(target, source, env):
# variant_dir is env['variant_dir']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With