From 44f2157541e1ea5f1caa10a2bb089baeb164edcd Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 10 Jan 2022 07:40:51 -0700 Subject: Refine Uguide variantdir description [skip appveyor] Responding to review comment - and going a bit further. Signed-off-by: Mats Wichmann --- doc/user/separate.xml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/user/separate.xml b/doc/user/separate.xml index cfb7c8b..3b609f0 100644 --- a/doc/user/separate.xml +++ b/doc/user/separate.xml @@ -53,13 +53,14 @@ lot of code, so it makes sense to keep them in the same source tree, but certain build options in the source code and header files differ. If you build "Controller A" first, - then "Controller B", on the second build everything would - have to be rebuilt, because &SCons; sees that the build - instructions are different to the ones used to build the - existing targets, and thus the existing targets are invalid. + then "Controller B", on the "Controller B" build everything would + have to be rebuilt, because &SCons; recognizes that the build + instructions are different from those used in the "Controller A" + build for each target - the build instructions are part of + &SCons;'s out-of-date calculation. Now when you go back and build for "Controller A", things have to be rebuilt from scratch again for the same reason. - However, if you can separate the places the output files go, + However, if you can separate the locations of the output files, this problem can be avoided. You can even set up to do both builds in one invocation of &SCons;. @@ -67,11 +68,20 @@ - You can enable this separation by creating one or more + You can enable this separation by establishing one or more variant directory trees that are used to perform the build in, and thus provide a unique home for object files, libraries, and executable programs, etc. - for a specific flavor, or variant, of build. + for a specific flavor, or variant, of build. &SCons; tracks + targets by their path, so when the variant directory is included, + objects belonging to "Controller A" can have different + build instructions than those belonging to "Controller B" without + triggering ping-ponging rebuilds. + + + + + &SCons; provides two ways to do this, one through the &f-link-SConscript; function that we've already seen, and the second through a more flexible &f-link-VariantDir; function. -- cgit v0.12