Search code examples
pythonscons

How to make python script for scons that use scons functions and variables


I want to make "common" script which I will use in all my sconscripts This script must use some scons functions like Object() or SharedObject() Is there any scons file that i can import or maybe another useful hack. Im new to python and scons.


Solution

  • I have done exactly what you are explaining. If your SConstruct and/or SConscript scripts simply import your common Python code, then there is nothing special you have to do, except import the appropriate SCons modules in your Python code.

    If, on the other hand, you have a Python script, from which you want to invoke SCons (as opposed to launching scons from the command line) then much more effort will be needed. I originally looked into doing this, but later decided it wasnt worth the effort.