常见的 Sconstruct 文件,如 Makefile.common
有没有办法在顶级目录中有一个 Sconstruct.common ,其中包含各个子目录共有的所有编译器/链接器选项,并在每个单独的子目录中具有单独的 Sconstruct 文件,其中包含为编译器/链接器指定其他参数的自定义选项选项 ?
(类似于在顶级目录中包含 Makefile.common 并在子目录中包含单独的 Makefile,包括 Makefile.common 并使用变量添加额外的参数)
谢谢, 普拉卡什
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 that 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,Scons 通常由顶级 SConstruct 文件组织,该文件设置公共构建命令(在环境中),并在项目的子目录中构建本地工件(对象、库、可执行文件等)的 SConscript 文件。在顶级 SConstruct 中,您可以使用 SConscript 命令列出要包含的 SConscript 文件。在 SConscript 文件中,您可以根据特定构建命令的需要覆盖某些环境变量,也可以克隆通用构建环境并以这种方式覆盖变量。
我强烈建议您阅读 Scons 用户指南。
此外,Scons 是 python,因此您还可以
导入
python 代码来进行跨项目可能常见的构建或部署操作。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.