aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/bin/init.cxx2
-rw-r--r--libbuild2/bin/rule.cxx2
-rw-r--r--libbuild2/cc/common.cxx27
-rw-r--r--libbuild2/cc/common.hxx4
-rw-r--r--libbuild2/cc/common.txx35
5 files changed, 40 insertions, 30 deletions
diff --git a/libbuild2/bin/init.cxx b/libbuild2/bin/init.cxx
index 34bfcd7..4af3c1d 100644
--- a/libbuild2/bin/init.cxx
+++ b/libbuild2/bin/init.cxx
@@ -1,4 +1,4 @@
-// file : build2/bin/init.cxx -*- C++ -*-
+// file : libbuild2/bin/init.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
#include <libbuild2/bin/init.hxx>
diff --git a/libbuild2/bin/rule.cxx b/libbuild2/bin/rule.cxx
index e6f234a..a2cdf8c 100644
--- a/libbuild2/bin/rule.cxx
+++ b/libbuild2/bin/rule.cxx
@@ -1,4 +1,4 @@
-// file : build2/bin/rule.cxx -*- C++ -*-
+// file : libbuild2/bin/rule.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
#include <libbuild2/bin/rule.hxx>
diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx
index 6bd9ac3..8150cfa 100644
--- a/libbuild2/cc/common.cxx
+++ b/libbuild2/cc/common.cxx
@@ -487,33 +487,6 @@ namespace build2
return xt->as<file> ();
}
- // Insert a target "tagging" it with the specified process path and
- // verifying that it already exists if requested. Return the lock.
- //
- template <typename T>
- ulock common::
- insert_library (context& ctx,
- T*& r,
- string name,
- dir_path dir,
- const process_path& out,
- optional<string> ext,
- bool exist,
- tracer& trace)
- {
- auto p (ctx.targets.insert_locked (T::static_type,
- move (dir),
- path_cast<dir_path> (out.effect),
- name,
- move (ext),
- true, // Implied.
- trace));
-
- assert (!exist || !p.second.owns_lock ());
- r = &p.first.template as<T> ();
- return move (p.second);
- }
-
// Note that pk's scope should not be NULL (even if dir is absolute).
//
target* common::
diff --git a/libbuild2/cc/common.hxx b/libbuild2/cc/common.hxx
index 422b761..b47f225 100644
--- a/libbuild2/cc/common.hxx
+++ b/libbuild2/cc/common.hxx
@@ -1,4 +1,4 @@
-// file : build2/cc/common.hxx -*- C++ -*-
+// file : libbuild2/cc/common.hxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
#ifndef LIBBUILD2_CC_COMMON_HXX
@@ -382,4 +382,6 @@ namespace build2
}
}
+#include <libbuild2/cc/common.hxx>
+
#endif // LIBBUILD2_CC_COMMON_HXX
diff --git a/libbuild2/cc/common.txx b/libbuild2/cc/common.txx
new file mode 100644
index 0000000..bfbc52c
--- /dev/null
+++ b/libbuild2/cc/common.txx
@@ -0,0 +1,35 @@
+// file : libbuild2/cc/common.txx -*- C++ -*-
+// license : MIT; see accompanying LICENSE file
+
+namespace build2
+{
+ namespace cc
+ {
+ // Insert a target "tagging" it with the specified process path and
+ // verifying that it already exists if requested. Return the lock.
+ //
+ template <typename T>
+ ulock common::
+ insert_library (context& ctx,
+ T*& r,
+ string name,
+ dir_path dir,
+ const process_path& out,
+ optional<string> ext,
+ bool exist,
+ tracer& trace)
+ {
+ auto p (ctx.targets.insert_locked (T::static_type,
+ move (dir),
+ path_cast<dir_path> (out.effect),
+ name,
+ move (ext),
+ true, // Implied.
+ trace));
+
+ assert (!exist || !p.second.owns_lock ());
+ r = &p.first.template as<T> ();
+ return move (p.second);
+ }
+ }
+}