aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.hxx
AgeCommit message (Collapse)AuthorFilesLines
2022-03-09Rename execute_wait() to execute()Boris Kolpackov1-14/+7
The old half-way semantics of execute() wasn't useful.
2022-03-09Parallel implementation of update_during_match_prerequisites()Boris Kolpackov1-7/+9
2022-03-08Improve performance of update during match for multiple targetsBoris Kolpackov1-0/+13
2022-03-02Add update operation-specific variable with unmatch|match additional valuesBoris Kolpackov1-0/+14
Note that the unmatch (match but do not update) and match (update during match) values are only supported by certain rules (and potentially only for certain prerequisite types). Additionally: - All operation-specific variables are now checked for false as an override for the prerequisite-specific include value. In particular, this can now be used to disable a prerequisite for update, for example: ./: exe{test}: update = false - The cc::link_rule now supports the update=match value for headers and ad hoc prerequisites. In particular, this can be used to make sure all the library headers are updated before matching any of its (or dependent's) object files.
2022-02-09Add perform_clean_group_extra()Boris Kolpackov1-0/+14
2022-02-07Make match_inc_dependents() part of public APIBoris Kolpackov1-0/+5
2022-01-21Add search_new() and search_new_locked() variants of search()Boris Kolpackov1-8/+44
2022-01-06Add depdb-dyndep --update-{include,exclude} optionsBoris Kolpackov1-2/+2
These options specify prerequisite targets/patterns to include/exclude (from the static prerequisite set) for update during match as part of dynamic dependency extraction (those excluded will be updated during execute). For example: depdb dyndep ... --update-exclude libue{hello-meta} ... depdb dyndep ... --update-exclude libue{*} ... depdb dyndep ... --update-include $moc --update-include hxx{*} ... The order in which these options are specified is significant with the first target/pattern that matches determining the result. If only the --update-include options are specified, then only the explicitly included prerequisites will be updated. Otherwise, all prerequisites that are not explicitly excluded will be updated. If none of these options is specified, then all the static prerequisites are updated during match. Note also that these options do not apply to ad hoc prerequisites which are always updated during match.
2021-09-20Add support for disabling clean through target-prerequisite relationshipBoris Kolpackov1-2/+14
Our current semantics is to clean any prerequisites that are in the same project (root scope) as the target and it may seem more natural to rather only clean prerequisites that are in the same base scope. While it's often true for simple projects, in more complex cases it's not unusual to have common intermediate build results (object files, utility libraries, etc) reside in the parent and/or sibling directories. With such arrangements, cleaning only in base (even from the project root) may leave such intermediate build results laying around (since there is no reason to list them as prerequisites of any directory aliases). So we clean in the root scope by default but now any target-prerequisite relationship can be marked not to trigger a clean with the clean=false prerequisite-specific value.
2021-06-08Implement ad hoc regex pattern rule supportBoris Kolpackov1-4/+6
An ad hoc pattern rule consists of a pattern that mimics a dependency declaration followed by one or more recipes. For example: exe{~'/(.*)/'}: cxx{~'/\1/'} {{ $cxx.path -o $path($>) $path($<[0]) }} If a pattern matches a dependency declaration of a target, then the recipe is used to perform the corresponding operation on this target. For example, the following dependency declaration matches the above pattern which means the rule's recipe will be used to update this target: exe{hello}: cxx{hello} While the following declarations do not match the above pattern: exe{hello}: c{hello} # Type mismatch. exe{hello}: cxx{howdy} # Name mismatch. On the left hand side of `:` in the pattern we can have a single target or an ad hoc target group. The single target or the first (primary) ad hoc group member must be a regex pattern (~). The rest of the ad hoc group members can be patterns or substitutions (^). For example: <exe{~'/(.*)/'} file{^'/\1.map/'}>: cxx{~'/\1/'} {{ $cxx.path -o $path($>[0]) "-Wl,-Map=$path($>[1])" $path($<[0]) }} On the left hand side of `:` in the pattern we have prerequisites which can be patterns, substitutions, or non-patterns. For example: <exe{~'/(.*)/'} file{^'/\1.map/'}>: cxx{~'/\1/'} hxx{^'/\1/'} hxx{common} {{ $cxx.path -o $path($>[0]) "-Wl,-Map=$path($>[1])" $path($<[0]) }} Substitutions on the left hand side of `:` and substitutions and non-patterns on the right hand side are added to the dependency declaration. For example, given the above rule and dependency declaration, the effective dependency is going to be: <exe{hello} file{hello.map>: cxx{hello} hxx{hello} hxx{common}
2021-03-16Define intermediate build results file cache interfaceBoris Kolpackov1-1/+1
2020-12-11Add search_locked() versions of search() functionsBoris Kolpackov1-0/+18
2020-12-03Add match_rule() in addition to match_recipe()Boris Kolpackov1-7/+15
2020-07-10Relax prerequisite filtering semantics of aliases for clean operationBoris Kolpackov1-2/+3
This is analogous to what has been done to test and install a couple of commits before.
2020-06-25Add more instrumentation for unassigned path raceBoris Kolpackov1-4/+4
2020-05-28Allow calling certain search_existing() versions during load phaseBoris Kolpackov1-3/+7
This is necessary for $target.path() implementation.
2020-04-30Factor recipe to separate header/source filesBoris Kolpackov1-2/+9
2020-04-27Add another search_existing() overloadBoris Kolpackov1-0/+3
2020-04-27Add inject() for injecting additional dependencies during matchBoris Kolpackov1-0/+7
2020-02-07Drop copyright notice from source codeKaren Arutyunov1-1/+0
2019-11-16Handle dry-run mode in backlinking implementationBoris Kolpackov1-1/+2
2019-10-29Add forward declaration header for build state typesBoris Kolpackov1-5/+1
2019-08-26Implement updating build system modulesBoris Kolpackov1-1/+1
2019-08-23Introduce notion of build contextBoris Kolpackov1-10/+17
All non-const global state is now in class context and we can now have multiple independent builds going on at the same time.
2019-08-01Fix linkage failure due to inline functions defined in ↵Karen Arutyunov1-3/+3
libbuild2/algorithm.ixx and referred from libbuild2/target.txx
2019-07-01Split build system into library and driverBoris Kolpackov1-0/+778