Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove buildcc base namespace and complete documentation #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d7fc226
Removed toolchain from namespace buildcc::base and added it to buildcc
coder137 Jan 16, 2022
9750ee8
Update test_toolchain_verify.cpp
coder137 Jan 16, 2022
596515d
Changed TargetEnv namespace from buildcc::base to buildcc
coder137 Jan 17, 2022
3a0abe2
Updated TargetConfig and TargetFileExt namespace from buildcc::base t…
coder137 Jan 17, 2022
427d384
Shifted TargetType from namespace buildcc::base to buildcc
coder137 Jan 17, 2022
a3d0bdb
Shifted TargetState namespace from buildcc::base to buildcc
coder137 Jan 17, 2022
b9bb12a
Shifted BuilderInterface from buildcc::base to buildcc::internal
coder137 Jan 17, 2022
3f31473
Shifted Generator from namespace buildcc::base to buildcc
coder137 Jan 17, 2022
97dc77b
Update target.rst
coder137 Jan 17, 2022
2ff11a3
Shift Api CRTP class from buildcc::base to buildcc::internal
coder137 Jan 18, 2022
7603e0d
Update target_info.h
coder137 Jan 18, 2022
e739d9e
Shifted TargetGetter namespace from buildcc::base to buildcc::internal
coder137 Jan 18, 2022
7e95a6a
Renamed buildcc::base::Target to buildcc::BaseTarget
coder137 Jan 18, 2022
3df4c24
Migrated Target from namespace buildcc::base to buildcc
coder137 Jan 18, 2022
687d07a
Updated CompileObject, CompilePch and LinkTarget namespace from build…
coder137 Jan 18, 2022
b0b6654
Minor naming updates
coder137 Jan 18, 2022
0301d50
Updated toolchain documentation
coder137 Jan 18, 2022
0fb0907
Updated specialized toolchain documentation
coder137 Jan 18, 2022
a148ff5
Updated generator documentation
coder137 Jan 18, 2022
6f595f9
Added target_utils
coder137 Jan 19, 2022
8570f82
Updated generator.rst
coder137 Jan 19, 2022
ec5f7bc
Updated target_utils with TargetFileExt and TargetConfig
coder137 Jan 19, 2022
ea9fa67
Update target_config.h
coder137 Jan 19, 2022
c35726c
Updated environment APIs
coder137 Jan 19, 2022
20b99d5
Update target_config.h
coder137 Jan 19, 2022
5a98122
Update target_config.h
coder137 Jan 19, 2022
9a44e20
Update target.rst
coder137 Jan 19, 2022
929e1cb
Update target.rst
coder137 Jan 19, 2022
ab43c57
Update target.rst
coder137 Jan 19, 2022
5602a77
Updated target utils
coder137 Jan 19, 2022
dc7086a
Update target.rst
coder137 Jan 19, 2022
71d7abc
Update TODO.md
coder137 Jan 19, 2022
9c04fb8
Update namespaces.rst
coder137 Jan 19, 2022
dea0296
Update target.rst
coder137 Jan 20, 2022
99e1219
Added compile.toml, immediate.toml and README for single example
coder137 Jan 20, 2022
0319d2a
Update testing.rst
coder137 Jan 20, 2022
9e0db6c
Update environment.rst
coder137 Jan 20, 2022
1bb7bd3
Update walkthroughs.rst
coder137 Jan 20, 2022
638bcfe
Update target_info.h
coder137 Jan 20, 2022
8a58fb8
Update target.h
coder137 Jan 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Contains the following working features

- Serialization Interface
- Namespace changes
- Remove ``buildcc::base``
- Remove ``buildcc::env``
- We should only have 3 namespaces ``buildcc``, ``buildcc::plugin`` and ``buildcc::internal``
- Environment updates
Expand Down
4 changes: 2 additions & 2 deletions buildcc/lib/args/include/args/register.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class Register {
*
* Target runs after dependency is built
*/
void Dep(const base::BuilderInterface &target,
const base::BuilderInterface &dependency);
void Dep(const internal::BuilderInterface &target,
const internal::BuilderInterface &dependency);

/**
* @brief Register the Target to be run
Expand Down
4 changes: 2 additions & 2 deletions buildcc/lib/args/mock/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace buildcc {

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

tf::Task Register::BuildGeneratorTask(base::Generator &generator) {
tf::Task Register::BuildGeneratorTask(BaseGenerator &generator) {
mock().actualCall(
fmt::format("BuildGeneratorTask_{}", generator.GetName()).c_str());
return build_tf_.placeholder().name(generator.GetUniqueId());
Expand Down
17 changes: 8 additions & 9 deletions buildcc/lib/args/src/args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ const std::unordered_map<const char *, buildcc::env::LogLevel> kLogLevelMap{
{"critical", buildcc::env::LogLevel::Critical},
};

const std::unordered_map<const char *, buildcc::base::Toolchain::Id>
kToolchainIdMap{
{"gcc", buildcc::ToolchainId::Gcc},
{"msvc", buildcc::ToolchainId::Msvc},
{"mingw", buildcc::ToolchainId::MinGW},
{"clang", buildcc::ToolchainId::Clang},
{"custom", buildcc::ToolchainId::Custom},
{"undefined", buildcc::ToolchainId::Undefined},
};
const std::unordered_map<const char *, buildcc::Toolchain::Id> kToolchainIdMap{
{"gcc", buildcc::ToolchainId::Gcc},
{"msvc", buildcc::ToolchainId::Msvc},
{"mingw", buildcc::ToolchainId::MinGW},
{"clang", buildcc::ToolchainId::Clang},
{"custom", buildcc::ToolchainId::Custom},
{"undefined", buildcc::ToolchainId::Undefined},
};

} // namespace

Expand Down
6 changes: 3 additions & 3 deletions buildcc/lib/args/src/register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ void Register::Clean(const std::function<void(void)> &clean_cb) {
}
}

void Register::Dep(const base::BuilderInterface &target,
const base::BuilderInterface &dependency) {
void Register::Dep(const internal::BuilderInterface &target,
const internal::BuilderInterface &dependency) {
const auto target_iter = build_.find(target.GetUniqueId());
const auto dep_iter = build_.find(dependency.GetUniqueId());
env::assert_fatal(!(target_iter == build_.end() || dep_iter == build_.end()),
Expand All @@ -88,7 +88,7 @@ void Register::Dep(const base::BuilderInterface &target,
}

void Register::Test(const ArgToolchainState &toolchain_state,
const std::string &command, const base::Target &target,
const std::string &command, const BaseTarget &target,
const TestConfig &config) {
if (!(toolchain_state.build && toolchain_state.test)) {
return;
Expand Down
4 changes: 2 additions & 2 deletions buildcc/lib/args/src/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

namespace buildcc {

tf::Task Register::BuildTargetTask(base::Target &target) {
tf::Task Register::BuildTargetTask(BaseTarget &target) {
return build_tf_.composed_of(target.GetTaskflow()).name(target.GetUniqueId());
}

tf::Task Register::BuildGeneratorTask(base::Generator &generator) {
tf::Task Register::BuildGeneratorTask(BaseGenerator &generator) {
return build_tf_.composed_of(generator.GetTaskflow())
.name(generator.GetUniqueId());
}
Expand Down
12 changes: 6 additions & 6 deletions buildcc/lib/args/test/test_args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ TEST(ArgsTestGroup, Args_CustomToolchain) {
// Toolchain
CHECK_TRUE(gcc_toolchain.state.build);
CHECK_FALSE(gcc_toolchain.state.test);
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
Expand Down Expand Up @@ -104,7 +104,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomToolchain) {
// GCC
CHECK_TRUE(gcc_toolchain.state.build);
CHECK_FALSE(gcc_toolchain.state.test);
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
Expand All @@ -115,7 +115,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomToolchain) {
// MSVC
CHECK_TRUE(msvc_toolchain.state.build);
CHECK_TRUE(msvc_toolchain.state.test);
CHECK(msvc_toolchain.id == buildcc::base::Toolchain::Id::Msvc);
CHECK(msvc_toolchain.id == buildcc::Toolchain::Id::Msvc);
STRCMP_EQUAL(msvc_toolchain.name.c_str(), "msvc");
STRCMP_EQUAL(msvc_toolchain.asm_compiler.c_str(), "cl");
STRCMP_EQUAL(msvc_toolchain.c_compiler.c_str(), "cl");
Expand Down Expand Up @@ -165,7 +165,7 @@ TEST(ArgsTestGroup, Args_CustomTarget) {
// Toolchain
CHECK_TRUE(gcc_toolchain.state.build);
CHECK_FALSE(gcc_toolchain.state.test);
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
Expand Down Expand Up @@ -219,7 +219,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomTarget) {
// Toolchain
CHECK_TRUE(gcc_toolchain.state.build);
CHECK_FALSE(gcc_toolchain.state.test);
CHECK(gcc_toolchain.id == buildcc::base::Toolchain::Id::Gcc);
CHECK(gcc_toolchain.id == buildcc::Toolchain::Id::Gcc);
STRCMP_EQUAL(gcc_toolchain.name.c_str(), "gcc");
STRCMP_EQUAL(gcc_toolchain.asm_compiler.c_str(), "as");
STRCMP_EQUAL(gcc_toolchain.c_compiler.c_str(), "gcc");
Expand All @@ -240,7 +240,7 @@ TEST(ArgsTestGroup, Args_MultipleCustomTarget) {
// Toolchain
CHECK_TRUE(msvc_toolchain.state.build);
CHECK_TRUE(msvc_toolchain.state.test);
CHECK(msvc_toolchain.id == buildcc::base::Toolchain::Id::Msvc);
CHECK(msvc_toolchain.id == buildcc::Toolchain::Id::Msvc);
STRCMP_EQUAL(msvc_toolchain.name.c_str(), "msvc");
STRCMP_EQUAL(msvc_toolchain.asm_compiler.c_str(), "cl");
STRCMP_EQUAL(msvc_toolchain.c_compiler.c_str(), "cl");
Expand Down
Loading