Is there a way to have a Sconstruct.common at the top level directory that has all the compiler/linker options that are common to individual subdirectories and have separate Sconstruct files within each individual subdirectory with custom options th开发者_如何学JAVAat specify additional arguments to the compiler/linker options ?
(Similiar to having Makefile.common in the top-level dir and individual Makefile in subdirs including Makefile.common and adding extra args using variables)
thanks, Prakash
Yes, Scons is usually organized with a top-level SConstruct file that sets up common build commands (in an Environment) and SConscript files in sub-directories of the project that build local artifacts (objects, libraries, executables, etc). In the top-level SConstruct, you list the SConscript files that you want to include using the SConscript command. In your SConscript files you can either override certain environment variables as needed in a particular build command, or you can Clone your common build environment and override variables that way.
I highly recommend reading through the Scons User's Guide.
Also, Scons is python, so you can also import
python code for build or deploy actions that might be common across projects.
精彩评论