📄 build_dir_option.txt
字号:
Copyright 2005 Vladimir PrusDistributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)Summary-------We need a --build-dir option that users building from read-onlymedium can use to force building to some other location. Pretty muchevery project need this functionality, so it's desirable to have itout-of-the box, without explicit setup.Design------We can achieve the desired effect manually by adding something like thisto Jamroot: project .... : build-dir [ my-rule-to-compute-build-dir ] ;Where 'my-rule-to-compute-build-dir' would look at the --build-dir option.We need to automate this, but essentially, --build-dir will only affectthe 'build-dir' attribute of Jamroots.If Jamroot contains: project foo ;and --build-dir options' value if /tmp/build, then we'll act as if Jamrootcontained: project foo : build-dir /tmp/build/foo ;If the 'project' rule has explicit 'build-dir': project foo : build-dir bin.v2 ;then with the same value of --build-dir we'd act as if Jamroot contained: project foo : build-dir /tmp/build/foo/bin.v2 ;We can't drop "bin.v2" because it's quite possible that the name of build dirhave specific meaning. For example, it can be used to separate Boost.Build V1and V2 build results.The --build-dir option has no effect if Jamroot does not define any project id.Doing otherwise can lead to nasty problems if we're building two distinctprojects (that is with two different Jamroot). They'll get the same builddirectory. Most likely, user will see the "duplicate target" error, which isgenerally confusing.It is expected that any non-trivial project will have top-level "project"invocation with non empty id, so the above limitation is not so drastic.We'll emit a warning if Jamroot does not define project id, and --build-diris specified.Here's the exact behavior of the --build-dir option. If we're loading aJamfile (either root or non-root), that declare some project id and somebuild-dir attribute, the following table gives the value of build-dirthat will actually be used.-------------------------------------------------------------------------------Root? Id Build-dir attribute Resulting build dir-------------------------------------------------------------------------------yes none * --build-dir is ignored, with warningyes 'foo' none /tmp/build/fooyes 'foo' 'bin.v2' /tmp/build/foo/bin.v2yes 'foo' '/tmp/bar' Error [1]no * none --build-dir has no effect, inherited build dir is usedno * non-empty Error [2]-------------------------------------------------------------------------------[1] -- not clear what to do[2] -- can be made to work, but non-empty build-dirattribute in non-root Jamfile does not make much sense even without --build-dir
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -