[Scons-users] scons not respecting variant_dir with object files

Dirk Bächle tshortik at gmx.de
Mon Jun 6 12:22:30 EDT 2016


Hi there!

On 06.06.2016 16:08, Jason Kenny wrote:
> I think there are a few tips I can share for this one.
>
> VariantDir works fine, but has a few quirks.
>
> If you call it yourself, you have to make sure the node that you create are correctly formed with the variant/build path. If you
> fail to do this the node will not build correctly. For example:
>
> VariantDir(“mybuild/dir”,”src/foo”)
>
> F0= File(“src/foo/a.cpp”)
>
> F1= File(“mybuild/dir /a.cpp”)
>
> Object(F0) # will build in src/foo, not in mybuild/dir
>
> Object(F1) # will build src/foo/a.cpp in mybuild/dir
>
> For this reason it is much easier to define
>
> SConscript(…, variant_dir)
>
> As this will allow you to define the nodes in a more natural way.
>

Yes, exactly this. +1 and thanks Jason. ;)

Dirk




More information about the Scons-users mailing list