aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/adhoc-rule-regex-pattern.cxx10
-rw-r--r--libbuild2/algorithm.cxx5
-rw-r--r--libbuild2/algorithm.hxx6
-rw-r--r--libbuild2/algorithm.ixx2
-rw-r--r--libbuild2/cc/link-rule.cxx3
5 files changed, 16 insertions, 10 deletions
diff --git a/libbuild2/adhoc-rule-regex-pattern.cxx b/libbuild2/adhoc-rule-regex-pattern.cxx
index c221bef..cd8c241 100644
--- a/libbuild2/adhoc-rule-regex-pattern.cxx
+++ b/libbuild2/adhoc-rule-regex-pattern.cxx
@@ -364,8 +364,9 @@ namespace build2
? "explicit target group member"
: "ad hoc target group member")));
- // @@ TODO: what if name contains extension? Shouldn't we call
- // split_name()?
+ // @@ TODO: save location in constructor?
+ //
+ optional<string> ext (target::split_name (n, location ()));
if (g != nullptr)
{
@@ -384,7 +385,7 @@ namespace build2
move (d),
dir_path (), // Always in out.
move (n),
- nullptr /* ext */,
+ ext ? &*ext : nullptr,
&bs));
const target& t (l.first); // Note: non-const only if have lock.
@@ -432,7 +433,8 @@ namespace build2
e.type,
move (d),
dir_path (), // Always in out.
- move (n));
+ move (n),
+ move (ext));
}
}
}
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index 8b7aa28..df8e650 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -364,7 +364,8 @@ namespace build2
const target_type& tt,
dir_path dir,
dir_path out,
- string n)
+ string n,
+ optional<string> ext)
{
tracer trace ("add_adhoc_member");
@@ -381,7 +382,7 @@ namespace build2
move (dir),
move (out),
move (n),
- nullopt /* ext */,
+ move (ext),
target_decl::implied,
trace,
true /* skip_find */));
diff --git a/libbuild2/algorithm.hxx b/libbuild2/algorithm.hxx
index c6fb1c2..2c57b74 100644
--- a/libbuild2/algorithm.hxx
+++ b/libbuild2/algorithm.hxx
@@ -285,10 +285,12 @@ namespace build2
const target_type&,
dir_path dir,
dir_path out,
- string name);
+ string name,
+ optional<string> ext);
// If the extension is specified then it is added to the member's target
- // name.
+ // name as a second-level extension (the first-level extension, if any,
+ // comes from the target type).
//
target&
add_adhoc_member (target&, const target_type&, const char* ext = nullptr);
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index 0d931dc..2fbec3f 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -374,7 +374,7 @@ namespace build2
n += e;
}
- return add_adhoc_member (t, tt, t.dir, t.out, move (n));
+ return add_adhoc_member (t, tt, t.dir, t.out, move (n), nullopt /* ext */);
}
inline target*
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index 0cd87b3..76e4a25 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -1695,7 +1695,8 @@ namespace build2
fsdir::static_type,
path_cast<dir_path> (t.path () + ".dlls"),
t.out,
- string () /* name */));
+ string () /* name */,
+ nullopt /* ext */));
// By default our backlinking logic will try to symlink the
// directory and it can even be done on Windows using junctions.