Scons Hierarchical Builds with Repository directory

浪尽此生 提交于 2019-12-04 21:49:38

SCons is looking for your source files in the app1 directory. If you specify the sources like this:

src=Split("#main.c #first.c #second.c")

then scons will search the Repositories for the source files.

A couple extra thoughts:

  1. You may want main.c to be in the app1 directory to avoid conflicts with main.c for other executables. In this case, remove the # from main.c in your source list.

  2. It's probably a good idea to define the Repositories in your top-level SConstruct if multiple apps share the repositories.

  3. It's often useful to build libraries from the shared sources so that unit tests can have their own main functions, but link the same sources as your apps (or so apps can share common modules). It may be easier to do this by putting SConscripts in the shared repository directory to build common libraries. Beyond the scope of this question, but something to consider as your project grows.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!