我正在尝试设置一个简单的bjam构建示例,我SubDir
在顶级Jamroot.jam
文件中使用该规则:
SubDir TOP ;
exe main : main.cpp ;
我正在使用boost_1_58_0
,当我省略SubDir
指令时,构建工作正常。
但是当我尝试使用时SubDir
,bjam声称该规则是未知的......虽然我看到Jambase
文件被解析:
dirkb@wks91:bjam_try$ BOOST_BUILD_ROOT=/home/dirkb/snaps/git/boost_1_58_0 BOOST_ROOT=/home/dirkb/snaps/git/boost_1_58_0 /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/engine/bin.linuxx86_64/b2 -f Jambase --debug-loading --debug-configuration
Parsing file: Jambase
notice: found boost-build.jam at /home/dirkb/snaps/git/boost_1_58_0/boost-build.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/boost-build.jam
notice: loading Boost.Build from /home/dirkb/snaps/git/boost_1_58_0/tools/build/src
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/bootstrap.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel/bootstrap.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel/modules.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel/modules.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/option.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build-system.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/build-request.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel/class.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/numbers.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel/errors.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/sequence.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/assert.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/set.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/regex.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/feature.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/indirect.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/utility.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/property.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/path.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/string.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/container.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/builtin.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/alias.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/project.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/print.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/scanner.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/property-set.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/virtual-target.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/type.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/generators.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/os.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/common.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/toolset.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util/order.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/targets.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/stage.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/register.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/asm.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/cpp.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/exe.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/html.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/lib.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/obj.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/objc.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/preprocessed.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/qt.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/types/rsp.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/symlink.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/message.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/convert.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/generate.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/configure.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/config-cache.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools/make.jam
Parsing file: /home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/version.jam
Initializing project 'test-config'
Assigned project target object(project-target)@62 to 'test-config'
Initializing project 'site-config'
Assigned project target object(project-target)@64 to 'site-config'
notice: Searching '/etc' '/home/dirkb' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src' '/usr/share/boost-build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/contrib' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/.' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in '/etc' '/home/dirkb' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src' '/usr/share/boost-build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/contrib' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/.'.
Initializing project 'user-config'
Assigned project target object(project-target)@66 to 'user-config'
notice: Searching '/home/dirkb' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src' '/usr/share/boost-build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/contrib' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/.' for user-config configuration file 'user-config.jam'.
notice: Configuration file 'user-config.jam' not found in '/home/dirkb' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src' '/usr/share/boost-build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/util' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/tools' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/contrib' '/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/.'.
Loading Jamfile at '.'
Initializing project 'Jamfile</disk2/stuff/dirkb/snaps/git/bjam_try>'
Assigned project target object(project-target)@68 to 'Jamfile</disk2/stuff/dirkb/snaps/git/bjam_try>'
Parsing file: Jamroot.jam
Jamroot.jam:1: in modules.load
ERROR: rule "SubDir" unknown in module "Jamfile</disk2/stuff/dirkb/snaps/git/bjam_try>".
/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/project.jam:325: in load-jamfile
/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/project.jam:64: in load
/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build/project.jam:145: in project.find
/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/build-system.jam:535: in load
/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel/modules.jam:289: in import
/home/dirkb/snaps/git/boost_1_58_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build
/home/dirkb/snaps/git/boost_1_58_0/boost-build.jam:17: in module scope
dirkb@wks91:bjam_try$
该Jambase
文件和一个 simpleJamrules
存在于我的玩具项目的顶层。当我省略“ -f Jambase
”选项时,bjam会选择内部 Jambase 定义 (+),但会产生相同的结果……SubDir
未知。
当我使用选项“ ”启动bjam-d 12
时,我看到SubDir
来自 的规则Jambase
被正确扫描,但不知何故,它没有正确绑定、定义或bjam通常为使方法/规则“可用”所做的任何事情。正如您可能从使用的路径中看到的那样,我只是引导b2
,所以boost
还没有正确安装。为了调试,我还稍微修补了它的来源,这就是“ Parsing file...
”消息的来源。
如何正确“注入”文件中的规则定义,以便在解析sJambase
时知道它们?Jamfile