Skip to content

Commit 3680ceb

Browse files
authored
Remove buildcc base namespace and complete documentation (#186)
1 parent 296b031 commit 3680ceb

File tree

98 files changed

+1424
-966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1424
-966
lines changed

TODO.md

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Contains the following working features
2626

2727
- Serialization Interface
2828
- Namespace changes
29-
- Remove ``buildcc::base``
3029
- Remove ``buildcc::env``
3130
- We should only have 3 namespaces ``buildcc``, ``buildcc::plugin`` and ``buildcc::internal``
3231
- Environment updates

buildcc/lib/args/include/args/register.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class Register {
107107
*
108108
* Target runs after dependency is built
109109
*/
110-
void Dep(const base::BuilderInterface &target,
111-
const base::BuilderInterface &dependency);
110+
void Dep(const internal::BuilderInterface &target,
111+
const internal::BuilderInterface &dependency);
112112

113113
/**
114114
* @brief Register the Target to be run

buildcc/lib/args/mock/tasks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
namespace buildcc {
66

7-
tf::Task Register::BuildTargetTask(base::Target &target) {
7+
tf::Task Register::BuildTargetTask(BaseTarget &target) {
88
mock().actualCall(fmt::format("BuildTask_{}", target.GetName()).c_str());
99
return build_tf_.placeholder().name(target.GetUniqueId());
1010
}
1111

12-
tf::Task Register::BuildGeneratorTask(base::Generator &generator) {
12+
tf::Task Register::BuildGeneratorTask(BaseGenerator &generator) {
1313
mock().actualCall(
1414
fmt::format("BuildGeneratorTask_{}", generator.GetName()).c_str());
1515
return build_tf_.placeholder().name(generator.GetUniqueId());

buildcc/lib/args/src/args.cpp

+8-9
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,14 @@ const std::unordered_map<const char *, buildcc::env::LogLevel> kLogLevelMap{
7575
{"critical", buildcc::env::LogLevel::Critical},
7676
};
7777

78-
const std::unordered_map<const char *, buildcc::base::Toolchain::Id>
79-
kToolchainIdMap{
80-
{"gcc", buildcc::ToolchainId::Gcc},
81-
{"msvc", buildcc::ToolchainId::Msvc},
82-
{"mingw", buildcc::ToolchainId::MinGW},
83-
{"clang", buildcc::ToolchainId::Clang},
84-
{"custom", buildcc::ToolchainId::Custom},
85-
{"undefined", buildcc::ToolchainId::Undefined},
86-
};
78+
const std::unordered_map<const char *, buildcc::Toolchain::Id> kToolchainIdMap{
79+
{"gcc", buildcc::ToolchainId::Gcc},
80+
{"msvc", buildcc::ToolchainId::Msvc},
81+
{"mingw", buildcc::ToolchainId::MinGW},
82+
{"clang", buildcc::ToolchainId::Clang},
83+
{"custom", buildcc::ToolchainId::Custom},
84+
{"undefined", buildcc::ToolchainId::Undefined},
85+
};
8786

8887
} // namespace
8988

buildcc/lib/args/src/register.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ void Register::Clean(const std::function<void(void)> &clean_cb) {
6666
}
6767
}
6868

69-
void Register::Dep(const base::BuilderInterface &target,
70-
const base::BuilderInterface &dependency) {
69+
void Register::Dep(const internal::BuilderInterface &target,
70+
const internal::BuilderInterface &dependency) {
7171
const auto target_iter = build_.find(target.GetUniqueId());
7272
const auto dep_iter = build_.find(dependency.GetUniqueId());
7373
env::assert_fatal(!(target_iter == build_.end() || dep_iter == build_.end()),
@@ -88,7 +88,7 @@ void Register::Dep(const base::BuilderInterface &target,
8888
}
8989

9090
void Register::Test(const ArgToolchainState &toolchain_state,
91-
const std::string &command, const base::Target &target,
91+
const std::string &command, const BaseTarget &target,
9292
const TestConfig &config) {
9393
if (!(toolchain_state.build && toolchain_state.test)) {
9494
return;

buildcc/lib/args/src/tasks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
namespace buildcc {
2222

23-
tf::Task Register::BuildTargetTask(base::Target &target) {
23+
tf::Task Register::BuildTargetTask(BaseTarget &target) {
2424
return build_tf_.composed_of(target.GetTaskflow()).name(target.GetUniqueId());
2525
}
2626

27-
tf::Task Register::BuildGeneratorTask(base::Generator &generator) {
27+
tf::Task Register::BuildGeneratorTask(BaseGenerator &generator) {
2828
return build_tf_.composed_of(generator.GetTaskflow())
2929
.name(generator.GetUniqueId());
3030
}

buildcc/lib/args/test/test_args.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ TEST(ArgsTestGroup, Args_CustomToolchain) {
6666
// Toolchain
6767
CHECK_TRUE(gcc_toolchain.state.build);
6868
CHECK_FALSE(gcc_toolchain.state.test);
69-
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
69+
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
7070
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
7171
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
7272
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
@@ -104,7 +104,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomToolchain) {
104104
// GCC
105105
CHECK_TRUE(gcc_toolchain.state.build);
106106
CHECK_FALSE(gcc_toolchain.state.test);
107-
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
107+
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
108108
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
109109
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
110110
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
@@ -115,7 +115,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomToolchain) {
115115
// MSVC
116116
CHECK_TRUE(msvc_toolchain.state.build);
117117
CHECK_TRUE(msvc_toolchain.state.test);
118-
CHECK(msvc_toolchain.id == buildcc::base::Toolchain::Id::Msvc);
118+
CHECK(msvc_toolchain.id == buildcc::Toolchain::Id::Msvc);
119119
STRCMP_EQUAL(msvc_toolchain.name.c_str(), "msvc");
120120
STRCMP_EQUAL(msvc_toolchain.asm_compiler.c_str(), "cl");
121121
STRCMP_EQUAL(msvc_toolchain.c_compiler.c_str(), "cl");
@@ -165,7 +165,7 @@ TEST(ArgsTestGroup, Args_CustomTarget) {
165165
// Toolchain
166166
CHECK_TRUE(gcc_toolchain.state.build);
167167
CHECK_FALSE(gcc_toolchain.state.test);
168-
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
168+
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
169169
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
170170
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
171171
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
@@ -219,7 +219,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomTarget) {
219219
// Toolchain
220220
CHECK_TRUE(gcc_toolchain.state.build);
221221
CHECK_FALSE(gcc_toolchain.state.test);
222-
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
222+
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
223223
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
224224
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
225225
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
@@ -240,7 +240,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomTarget) {
240240
// Toolchain
241241
CHECK_TRUE(msvc_toolchain.state.build);
242242
CHECK_TRUE(msvc_toolchain.state.test);
243-
CHECK(msvc_toolchain.id == buildcc::base::Toolchain::Id::Msvc);
243+
CHECK(msvc_toolchain.id == buildcc::Toolchain::Id::Msvc);
244244
STRCMP_EQUAL(msvc_toolchain.name.c_str(), "msvc");
245245
STRCMP_EQUAL(msvc_toolchain.asm_compiler.c_str(), "cl");
246246
STRCMP_EQUAL(msvc_toolchain.c_compiler.c_str(), "cl");

0 commit comments

Comments
 (0)