aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/search.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-10-20 12:26:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-20 12:26:35 +0200
commitcddb2d17e71887fdb325afdc67905201d0220b13 (patch)
tree175760231452f2658a9c017d9d347dbcf3312bfa /libbuild2/search.cxx
parentb85ec1f2cc27ee178488de480eb3f64245a6e563 (diff)
Don't create targets for non-existent source files
Diffstat (limited to 'libbuild2/search.cxx')
-rw-r--r--libbuild2/search.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/libbuild2/search.cxx b/libbuild2/search.cxx
index c2f7de4..3bdb503 100644
--- a/libbuild2/search.cxx
+++ b/libbuild2/search.cxx
@@ -231,6 +231,12 @@ namespace build2
const target_key& tk (pk.tk);
+ // If out is present, then it means the target is in src and we shouldn't
+ // be creating new targets in src, should we? Feels like this should not
+ // even be called if out is not empty.
+ //
+ assert (tk.out->empty ());
+
// We default to the target in this directory scope.
//
dir_path d;
@@ -251,13 +257,6 @@ namespace build2
//
// More often insert than find, so skip find in insert().
//
- // @@ OUT: same story as in search_existing_target() re out. Maybe not:
- // if out is present, then it means the target is in src and we
- // shouldn't be creating new targets in src, should we? Feels
- // like this should not even be called in out is not empty.
- //
- //assert (tk.out->empty ()); @@ TMP
-
auto r (ctx.targets.insert (*tk.type,
move (d),
*tk.out,
@@ -280,6 +279,12 @@ namespace build2
const target_key& tk (pk.tk);
+ // If out is present, then it means the target is in src and we shouldn't
+ // be creating new targets in src, should we? Feels like this should not
+ // even be called if out is not empty.
+ //
+ assert (tk.out->empty ());
+
// We default to the target in this directory scope.
//
dir_path d;
@@ -300,13 +305,6 @@ namespace build2
//
// More often insert than find, so skip find in insert_locked().
//
- // @@ OUT: same story as in search_existing_target() re out. Maybe not:
- // if out is present, then it means the target is in src and we
- // shouldn't be creating new targets in src, should we? Feels
- // like this should not even be called in out is not empty.
- //
- //assert (tk.out->empty ()); @@ TMP
-
auto r (ctx.targets.insert_locked (*tk.type,
move (d),
*tk.out,