aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.hxx
AgeCommit message (Collapse)AuthorFilesLines
2024-11-04Redo group_prerequisites to use snapshots of prerequisites (GH issue #408)Boris Kolpackov1-10/+8
It turns out both target and group prerequisites can be replaced during dependency synthesis in more obscure cases.
2024-10-29Tweak some more fix for data race in ad hoc member state when group is postponedBoris Kolpackov1-3/+2
2024-10-28Fix data race in ad hoc member state when group is postponedBoris Kolpackov1-3/+7
2024-08-06Rename certain target_set::insert() versions to insert_implied() for clarityBoris Kolpackov1-36/+41
Also clarify the target_decl documentation.
2024-07-31Add lookup limit to {scope,target}::lookup_original()Boris Kolpackov1-12/+28
2024-07-29Add scope::lookup_original_info() that provides additional info about lookupBoris Kolpackov1-4/+6
2024-02-22Detect non-cc::link_rule libraries not marked with cc.type=ccBoris Kolpackov1-2/+25
Fixes GH issue #368.
2024-02-22Deal with libs{} being member of group in windows_rpath_timestamp()Boris Kolpackov1-6/+6
Fixes GH issue #366.
2024-02-12Add ability to specify recipes in separate filesBoris Kolpackov1-0/+16
This can now be achieved with the new `recipe` directive: recipe <language> <file> Note that similar to the use of if-else and switch directives with recipes, this directive requires explicit % recipe header. For example, instead of: file{foo.output}: {{ echo 'hello' >$path($>) }} We can now write: file{foo.output}: % recipe buildscript hello.buildscript With hello.buildscript containing: echo 'hello' >$path($>) Similarly, for C++ recipes (this time for a pattern), instead of: [rule_name=hello] file{~'/(.+)\.output/'}: % update clean {{ c++ 1 -- -- ... }} We can now write: [rule_name=hello] file{~'/(.+)\.output/'}: % update clean recipe c++ hello.cxx With hello.cxx containing: // c++ 1 -- -- ... Relative <file> paths are resolved using the buildfile directory that contains the `recipe` directive as a base. Note also that this mechanism can be used in exported buildfiles with recipe files placed into build/export/ together with buildfiles.
2024-02-12Extend class target, prerequisite_target interfacesBoris Kolpackov1-2/+34
2023-12-03Reimplement search_existing() functions via target_type::searchBoris Kolpackov1-5/+12
This allows us to automatically get the target type-specific behavior with regards to the out_only semantics (added in the previous commit) instead of passing it explicitly from each call site.
2023-11-21Add target::append_locked() variantBoris Kolpackov1-2/+8
2023-11-16Fix target::group_state() for unmatched ad hoc group membersBoris Kolpackov1-1/+1
2023-11-07Account for match options re-locking when checking if target is matchedBoris Kolpackov1-0/+2
2023-11-03Fix data race in match options logicBoris Kolpackov1-9/+13
2023-11-01Add support for adjusting match options of post hoc prerequisitesBoris Kolpackov1-1/+11
2023-11-01Add notion of match optionsBoris Kolpackov1-6/+101
Now, when matching a rule, the caller may request a subset of the full functionality of performing an operation on a target. This is achieved with match options.
2023-10-06Handle 0 mask in update_during_match_prerequisites()Boris Kolpackov1-1/+2
2023-08-02Diagnose declarations of targets/prerequisites with abstract target typesBoris Kolpackov1-1/+1
2023-07-20Consider unmatched prerequisites in updated_during_match() checkBoris Kolpackov1-2/+9
2023-06-15Fix incorrect memory order in target::matched() callBoris Kolpackov1-1/+1
2023-06-02Fix data race in library metadata protocol logicBoris Kolpackov1-1/+5
2023-06-01Diagnose null include, operation-specific variable valuesBoris Kolpackov1-3/+1
While assigning null directly is unlikely, it's fairly easy via a variable expansion. Real-world example: ./: exe{tensor}: include = $config.Eigen.unsupported
2023-06-01Add inner_recipe for expressivenessBoris Kolpackov1-1/+1
2023-06-01Resolve (but disable for now) target_count issue in resolve_members()Boris Kolpackov1-14/+19
2023-05-29Avoid group linkup deadlocks for dynamic and pattern-static membersBoris Kolpackov1-2/+5
2023-05-29Explicit group: dynamic membersBoris Kolpackov1-4/+5
2023-05-29Explicit group: static membersBoris Kolpackov1-4/+32
2023-05-29Explicit group: syntax parsingBoris Kolpackov1-2/+33
2023-05-21Add support for dynamic target extraction in addition to prerequisitesBoris Kolpackov1-0/+4
This functionality is enabled with the depdb-dyndep --dyn-target option. Only the make format is supported, where the listed targets are added as ad hoc group members (unless already specified as static members). This functionality is not available in the --byproduct mode.
2023-03-02Replace deprecated std::aligned_storage with alignasBoris Kolpackov1-4/+4
Based on patch by Matthew Krupcale.
2022-11-30Reserve targets, variables to avoid rehashingBoris Kolpackov1-0/+4
2022-11-18Complete low verbosity diagnostics reworkBoris Kolpackov1-4/+4
2022-10-19Add support for post hoc prerequisitesBoris Kolpackov1-2/+11
Unlike normal and ad hoc prerequisites, a post hoc prerequisite is built after the target, not before. It may also form a dependency cycle together with normal/ad hoc prerequisites. In other words, all this form of dependency guarantees is that a post hoc prerequisite will be built if its dependent target is built. See the NEWS file for details and an example.
2022-10-10Preparatory work for public/private variable distinctionBoris Kolpackov1-15/+15
We still always use the public var_pool from context but where required, all access now goes through scope::var_pool().
2022-09-21Fix regression in dynamic dependency extraction, byproduct modeBoris Kolpackov1-0/+3
2022-09-12Do not treat primary ad hoc group member as group for variable lookupBoris Kolpackov1-0/+14
Note that we started with this semantics but it was changed in a commit on 2021-09-16 for reasons not entirely unclear but most likely due to target- specific variables specified for the group not being set on all the members. Which we have now addressed (see the previous commit). Note also that this new (old) semantics is not without its own drawbacks. Specifically, there is a bit of waste when the target-specific variable is really only meant for the recipe and thus setting it on all the members is unnecessary. For example: <{hxx ixx cxx}{options}>: cli{options} { options = ... } {{ # Use options. }} But this feels like a quality of implementation rather than conceptual issue. For example, we could likely one day address it by synthesizing a separate group target for ad hoc groups.
2022-06-29Make sure we generate common pkg-config file for only liba{}/libs{}Boris Kolpackov1-4/+10
2022-06-24Allow ad hoc rules not to list targets that are updated during matchBoris Kolpackov1-6/+27
For example, this allows a Qt moc rule not to list generated headers from libQtCore since they are pre-generated by the library.
2022-06-22Add missing match_data() destructorBoris Kolpackov1-0/+5
2022-04-20Replace match_extra::buffer with more general data storage facilityBoris Kolpackov1-2/+66
2022-04-19Use target recipe for auxiliary data storage during match-applyBoris Kolpackov1-41/+92
In particular, we now have separate auxiliary data storage for inner and outer operations.
2022-04-19Switch to using std::function for target::data_padBoris Kolpackov1-34/+80
2022-04-19Skip find() inside target_set::insert*() if target is unlikely to be thereBoris Kolpackov1-7/+19
2022-04-19Cache "recipe is group_action" information, clear recipes after executionBoris Kolpackov1-0/+1
2022-04-18Avoid locking target set if in load phaseBoris Kolpackov1-5/+15
2022-04-15Get rid of target::dynamic_type() virtual functionBoris Kolpackov1-35/+85
Instead of overriding this function, derived targets must now set the dynamic_type variable to their static_type in their constructor body.
2022-04-13Cache target base scope lookupsBoris Kolpackov1-5/+31
2022-04-07Rename {match,execute}() to *_sync(), add *_complete()Boris Kolpackov1-2/+2
In particular, the match() rename makes sure it doesn't clash with rule::match() which, after removal of the hint argument in simple_rule, has exactly the same signature, thus making it error-prone to calling recursively.
2022-04-06Add support for rule hintsBoris Kolpackov1-9/+60
A rule hint is a target attribute, for example: [rule_hint=cxx] exe{hello}: c{hello} Rule hints can be used to resolve ambiguity when multiple rules match the same target as well as to override an unambiguous match.