- Notifications
You must be signed in to change notification settings - Fork3
RefactorRegister constructable class toReg static class#204
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
39 commits Select commitHold shift + click to select a range
448125c Update args.rst
coder137363d3ff Updated Args
coder137d78b379 Updated Args bool APIs
coder1377c3c300 Updated args and test_args
coder137b743dc0 Added Reg API
coder1379808773 Updated register
coder1378429d17 Updated register
coder13732d45d3 Updated register
coder1374ecbcea Updated example build files
coder1370c2c1ac Update register.h
coder1373115ace Update args.h
coder137524a033 Updated examples
coder137b5cb26f Updated bootstrap and buildexe
coder137991839e Update build.main.cpp
coder137f8f3bac Updated Register
coder1374c76a28 Updated register
coder1373ce5975 Update test_register.cpp
coder137b4d6faf Updated register, Shifted internally
coder1377b35311 Update build.cpp
coder137623aefd Renamed Register to Instance
coder137a7e851a Updated Reg::Instance
coder137deb2666 Updated register dep usage
coder1374333c9c Removed executor from Reg::Instance
coder137d4a4cb0 Updated register
coder1379ceecd0 Update tpl buildcc script
coder1370d82f8b Update build_buildcc.cpp
coder13701e910c Update register.h
coder1377476c0e Update build_buildcc.cpp
coder137b5c4ba9 Update register.h
coder13762c88fc Update build_buildcc.cpp
coder1377e78a67 Update main.buildcc.cpp
coder13749dc94a Update args.h
coder137d00723a Update register.h
coder137b46eba8 Updated documentation
coder137beea759 Updated documentation
coder13737c839a Updated documentation
coder137a0bc5ab Update test_register.cpp
coder1374e76dd6 Update test_register.cpp
coder13784212c1 Update test_register.cpp
coder137File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
6 changes: 2 additions & 4 deletionsbootstrap/include/bootstrap/build_buildcc.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletionsbootstrap/include/bootstrap/build_tpl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -21,13 +21,7 @@ | ||
| namespace buildcc { | ||
| void tpl_cb(BaseTarget &target); | ||
| } // namespace buildcc | ||
19 changes: 10 additions & 9 deletionsbootstrap/main.buildcc.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -38,31 +38,32 @@ int main(int argc, char **argv) { | ||
| .AddToolchain("host", "Host Toolchain", custom_toolchain_arg) | ||
| .Parse(argc, argv); | ||
| Reg::Init(); | ||
| Reg::Call(Args::Clean()).Func(clean_cb); | ||
coder137 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| BaseToolchain toolchain = custom_toolchain_arg.ConstructToolchain(); | ||
| toolchain.Verify(); | ||
| BuildBuildCC buildcc( | ||
| toolchain, TargetEnv(Project::GetRootDir(), Project::GetBuildDir())); | ||
| buildcc.Setup(custom_toolchain_arg.state); | ||
| const auto &buildcc_lib = buildcc.GetBuildcc(); | ||
| ExecutableTarget_generic buildcc_hybrid_simple_example( | ||
| "buildcc_hybrid_simple_example", toolchain, "example/hybrid/simple"); | ||
| Reg::Toolchain(custom_toolchain_arg.state) | ||
| .Build(hybrid_simple_example_cb, buildcc_hybrid_simple_example, | ||
| buildcc_lib) | ||
| .Dep(buildcc_hybrid_simple_example, buildcc_lib); | ||
| // Runners | ||
| Reg::Run(); | ||
| // - Clang Compile Commands | ||
| plugin::ClangCompileCommands({&buildcc_lib}).Generate(); | ||
| // - Plugin Graph | ||
| std::string output =Reg::GetTaskflow().dump(); | ||
| const bool saved = env::save_file("graph.dot", output, false); | ||
| env::assert_fatal(saved, "Could not save graph.dot file"); | ||
41 changes: 20 additions & 21 deletionsbootstrap/src/build_buildcc.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -131,7 +131,6 @@ void buildcc_cb(BaseTarget &target, const BaseGenerator &schema_gen, | ||
| if constexpr (env::is_win()) { | ||
| // TODO, Clang | ||
| switch (target.GetToolchain().GetId()) { | ||
| case ToolchainId::MinGW: { | ||
| target.AddPreprocessorFlag("-DFMT_HEADER_ONLY=1"); | ||
| target.AddPreprocessorFlag("-DSPDLOG_FMT_EXTERNAL"); | ||
| @@ -147,7 +146,7 @@ void buildcc_cb(BaseTarget &target, const BaseGenerator &schema_gen, | ||
| } | ||
| } | ||
| if constexpr (env::is_linux() || env::is_unix() || env::is_clang()) { | ||
| // TODO, Clang | ||
| switch (target.GetToolchain().GetId()) { | ||
| case ToolchainId::Gcc: { | ||
| @@ -196,51 +195,41 @@ void BuildBuildCC::Setup(const ArgToolchainState &state) { | ||
| TargetEnv(env_.GetTargetRootDir() / "third_party" / "flatbuffers", | ||
coder137 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| env_.GetTargetBuildDir())); | ||
| // Schema | ||
| auto &schema_gen = storage_.Add<BaseGenerator>( | ||
| kSchemaGenName, kSchemaGenName, | ||
| TargetEnv(env_.GetTargetRootDir() / "buildcc" / "schema", | ||
| env_.GetTargetBuildDir() / toolchain_.GetName())); | ||
| // Flatbuffers HO lib | ||
| auto &flatbuffers_ho_lib = storage_.Add<TargetInfo>( | ||
| kFlatbuffersHoName, toolchain_, | ||
| TargetEnv(env_.GetTargetRootDir() / "third_party" / "flatbuffers", | ||
| env_.GetTargetBuildDir())); | ||
| // CLI11 HO lib | ||
| auto &cli11_ho_lib = storage_.Add<TargetInfo>( | ||
| kCli11HoName, toolchain_, | ||
| TargetEnv(env_.GetTargetRootDir() / "third_party" / "CLI11", | ||
| env_.GetTargetBuildDir())); | ||
| // fmt HO lib | ||
| auto &fmt_ho_lib = storage_.Add<TargetInfo>( | ||
| kFmtHoName, toolchain_, | ||
| TargetEnv(env_.GetTargetRootDir() / "third_party" / "fmt", | ||
| env_.GetTargetBuildDir())); | ||
| // spdlog HO lib | ||
| auto &spdlog_ho_lib = storage_.Add<TargetInfo>( | ||
| kSpdlogHoName, toolchain_, | ||
| TargetEnv(env_.GetTargetRootDir() / "third_party" / "spdlog", | ||
| env_.GetTargetBuildDir())); | ||
| // taskflow HO lib | ||
| auto &taskflow_ho_lib = storage_.Add<TargetInfo>( | ||
| kTaskflowHoName, toolchain_, | ||
| TargetEnv(env_.GetTargetRootDir() / "third_party" / "taskflow", | ||
| env_.GetTargetBuildDir())); | ||
| // Tiny-process-library lib | ||
| // TODO, Make this a generic selection between StaticTarget and | ||
| @@ -250,21 +239,31 @@ void BuildBuildCC::Setup(const ArgToolchainState &state) { | ||
| TargetEnv(env_.GetTargetRootDir() / "third_party" / | ||
| "tiny-process-library", | ||
| env_.GetTargetBuildDir())); | ||
| // BuildCC lib | ||
| // TODO, Make this a generic selection between StaticTarget and | ||
| // DynamicTarget | ||
| auto &buildcc_lib = storage_.Add<StaticTarget_generic>( | ||
| kBuildccLibName, kBuildccLibName, toolchain_, | ||
| TargetEnv(env_.GetTargetRootDir() / "buildcc", env_.GetTargetBuildDir())); | ||
| Reg::Toolchain(state) | ||
| .Func(global_flags_cb, flatc_exe, toolchain_) | ||
| .Build(build_flatc_exe_cb, flatc_exe) | ||
| .Build(schema_gen_cb, schema_gen, flatc_exe) | ||
| .Dep(schema_gen, flatc_exe) | ||
| .Func(flatbuffers_ho_cb, flatbuffers_ho_lib) | ||
| .Func(cli11_ho_cb, cli11_ho_lib) | ||
| .Func(fmt_ho_cb, fmt_ho_lib) | ||
| .Func(spdlog_ho_cb, spdlog_ho_lib) | ||
| .Func(taskflow_ho_cb, taskflow_ho_lib) | ||
| .Func(global_flags_cb, tpl_lib, toolchain_) | ||
| .Build(tpl_cb, tpl_lib) | ||
| .Func(global_flags_cb, buildcc_lib, toolchain_) | ||
| .Build(buildcc_cb, buildcc_lib, schema_gen, flatbuffers_ho_lib, | ||
| fmt_ho_lib, spdlog_ho_lib, cli11_ho_lib, taskflow_ho_lib, tpl_lib) | ||
| .Dep(buildcc_lib, schema_gen) | ||
| .Dep(buildcc_lib, tpl_lib); | ||
| } | ||
| } // namespace buildcc | ||
15 changes: 5 additions & 10 deletionsbootstrap/src/build_tpl.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
124 changes: 69 additions & 55 deletionsbuildcc/lib/args/include/args/args.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.