aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/context.cxx1
-rw-r--r--libbuild2/context.hxx9
-rw-r--r--libbuild2/install/operation.cxx2
-rw-r--r--libbuild2/operation.cxx10
-rw-r--r--libbuild2/operation.hxx11
-rw-r--r--libbuild2/test/operation.cxx2
6 files changed, 19 insertions, 16 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx
index f4d8a39..23cef44 100644
--- a/libbuild2/context.cxx
+++ b/libbuild2/context.cxx
@@ -11,7 +11,6 @@
#include <libbuild2/scope.hxx>
#include <libbuild2/target.hxx>
#include <libbuild2/variable.hxx>
-#include <libbuild2/operation.hxx>
#include <libbuild2/diagnostics.hxx>
#include <libbutl/ft/exception.hxx> // uncaught_exceptions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index 31930a1..1d20acb 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -13,6 +13,7 @@
// likely a non-starter.
//
#include <libbuild2/action.hxx>
+#include <libbuild2/operation.hxx>
#include <libbuild2/scheduler.hxx>
#include <libbuild2/export.hxx>
@@ -32,9 +33,6 @@ namespace build2
class value;
using values = small_vector<value, 1>;
- struct meta_operation_info;
- struct operation_info;
-
struct opspec;
class LIBBUILD2_SYMEXPORT run_phase_mutex
@@ -363,6 +361,11 @@ namespace build2
//
const variable* var_build_meta_operation;
+ // Known meta-operation and operation tables.
+ //
+ build2::meta_operation_table meta_operation_table;
+ build2::operation_table operation_table;
+
// The old/new src_root remapping for subprojects.
//
dir_path old_src_root;
diff --git a/libbuild2/install/operation.cxx b/libbuild2/install/operation.cxx
index 1135ad6..a2ad7d0 100644
--- a/libbuild2/install/operation.cxx
+++ b/libbuild2/install/operation.cxx
@@ -4,6 +4,8 @@
#include <libbuild2/install/operation.hxx>
+#include <libbuild2/variable.hxx>
+
using namespace std;
using namespace butl;
diff --git a/libbuild2/operation.cxx b/libbuild2/operation.cxx
index c07d359..0bf87d5 100644
--- a/libbuild2/operation.cxx
+++ b/libbuild2/operation.cxx
@@ -10,6 +10,7 @@
#include <libbuild2/scope.hxx>
#include <libbuild2/target.hxx>
#include <libbuild2/context.hxx>
+#include <libbuild2/variable.hxx>
#include <libbuild2/algorithm.hxx>
#include <libbuild2/diagnostics.hxx>
@@ -546,8 +547,8 @@ namespace build2
<< "out_root: " << cast<dir_path> (rs[ctx.var_out_root]) << endl
<< "amalgamation: " << cast_empty<dir_path> (rs[ctx.var_amalgamation]) << endl
<< "subprojects: " << cast_empty<subprojects> (rs[ctx.var_subprojects]) << endl
- << "operations:"; print_ops (rs.root_extra->operations, operation_table); cout << endl
- << "meta-operations:"; print_ops (rs.root_extra->meta_operations, meta_operation_table); cout << endl;
+ << "operations:"; print_ops (rs.root_extra->operations, ctx.operation_table); cout << endl
+ << "meta-operations:"; print_ops (rs.root_extra->meta_operations, ctx.meta_operation_table); cout << endl;
}
}
@@ -623,9 +624,4 @@ namespace build2
nullptr,
nullptr
};
-
- // Tables.
- //
- string_table<meta_operation_id, meta_operation_data> meta_operation_table;
- string_table<operation_id> operation_table;
}
diff --git a/libbuild2/operation.hxx b/libbuild2/operation.hxx
index 0d56219..520b37b 100644
--- a/libbuild2/operation.hxx
+++ b/libbuild2/operation.hxx
@@ -11,7 +11,6 @@
#include <libbuild2/utility.hxx>
#include <libbuild2/action.hxx>
-#include <libbuild2/variable.hxx>
#include <libbuild2/target-state.hxx>
#include <libbuild2/export.hxx>
@@ -26,6 +25,9 @@ namespace build2
class include_type;
struct prerequisite_member;
+ class value;
+ using values = small_vector<value, 1>;
+
struct opspec;
// Meta-operation info.
@@ -296,11 +298,10 @@ namespace build2
return os << d.name;
}
- LIBBUILD2_SYMEXPORT extern butl::string_table<meta_operation_id,
- meta_operation_data>
- meta_operation_table;
+ using meta_operation_table = butl::string_table<meta_operation_id,
+ meta_operation_data>;
- LIBBUILD2_SYMEXPORT extern butl::string_table<operation_id> operation_table;
+ using operation_table = butl::string_table<operation_id>;
// These are "sparse" in the sense that we may have "holes" that
// are represented as NULL pointers. Also, lookup out of bounds
diff --git a/libbuild2/test/operation.cxx b/libbuild2/test/operation.cxx
index 3ff7702..0ca8da0 100644
--- a/libbuild2/test/operation.cxx
+++ b/libbuild2/test/operation.cxx
@@ -4,6 +4,8 @@
#include <libbuild2/test/operation.hxx>
+#include <libbuild2/variable.hxx>
+
using namespace std;
using namespace butl;