From 2c7241e1c0b274d1eeaa1472ea14661b3d379a93 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Fri, 14 Jan 2022 19:49:35 -0800 Subject: [PATCH 01/18] Update TODO.md --- TODO.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/TODO.md b/TODO.md index aee3c6f6..580db67f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,71 @@ +# Versions + +# 0.1.1 + +Complete working proof of concept of the following + +- BuildCC library +- BuildCC bootstrap "script" files (Basic) +- BuildExe executable (Standalone) + +Contains the following working features + +**BuildCC** +- Supported plugin + - Clang Compile Commands +- Toolchain, Generator, TargetInfo and Target interfaces +- Specialized Toolchain for GCC, MSVC and MINGW +- Specialized Target for GCC, MSVC and MINGW + +**BuildExe** +- Immediate mode +- Script mode +- Local Package Manager with git + +## 0.1.2 + +- Serialization Interface +- Namespace changes + - Remove ``buildcc::base`` + - Remove ``buildcc::env`` + - We should only have 3 namespaces ``buildcc``, ``buildcc::plugin`` and ``buildcc::internal`` +- Environment updates + - Remove ``buildcc::env`` + - Refactor free / static functions and variables into classes with static members and variables. For example. ``buildcc::env::init`` should become ``buildcc::Environment::Init`` +- Args and Register module updates + - Pch command from command line + - Make Register functions static. ``Register::Build`` + - Update ``CallbackIf``, ``Build`` and ``Test`` APIs for the ``state`` variable usage +- Unit testing and mocking for BuildExe + +## 0.1.3 + +- Make a common interface / internal library which contains all utility functions and libraries +- New generators + - Currently we only have a simple Generator which is similar to our FileIOGenerator (input -> subprocess commands -> outputs) + - Read the ``faq`` generators to make more varied and robust generators. + +## 0.1.4 + +- Config options updates as per Target requirements + - Update configs to use ``fmt::format`` with format specifiers for "{prefix}{value}{suffix}" for customizability. For example: `/D{preprocessor}` for msvc or `-D{preprocessor}` for gcc etc +- Target specialized clang + - Clang behaves differently depending on its backend + - Option 1: Consider adding more options to ``ToolchainId`` and different Clang specializations. For example: ``Target_gcc_clang`` or ``Target_msvc_clang`` or ``Target_mingw_clang`` etc + - Option 2: Consider making a ``Target_clang`` that changes behaviour as per the ``target_triple_architecture`` present in the ``toolchain`` + - What other flavours of clang are present? + +## 0.2.x + +- `Append*` APIs +- `Add*WithFormat` or `Append*WithFormat` APIs + +## Long Term goals + +- [Discussion] Supported plugin requirements by users +- [Discussion] Customizability requirements by users +- [Discussion] Target and Generator interfaces for standardization by compilers. (White paper) +- [Community Support] MacOS testing and CI/CD # Feature From de3987d563554b71ae1679bbd13a29c2a87f956a Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 02:16:26 -0800 Subject: [PATCH 02/18] Update toc.rst --- docs/source/user_api/toc.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/user_api/toc.rst b/docs/source/user_api/toc.rst index 21859ffa..a9c70857 100644 --- a/docs/source/user_api/toc.rst +++ b/docs/source/user_api/toc.rst @@ -4,10 +4,10 @@ User API .. toctree:: - environment + args + register toolchain generator target - args - register supported_plugins + environment From a40a9f62974cff8047d046337424e46362203322 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 02:16:35 -0800 Subject: [PATCH 03/18] Updated args --- buildcc/lib/args/include/args/args.h | 24 +++++++++-- docs/source/user_api/args.rst | 61 ++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/buildcc/lib/args/include/args/args.h b/buildcc/lib/args/include/args/args.h index 4f461707..d9cdd635 100644 --- a/buildcc/lib/args/include/args/args.h +++ b/buildcc/lib/args/include/args/args.h @@ -88,10 +88,22 @@ class Args { Args() { Initialize(); } Args(const Args &) = delete; + /** + * @brief Parse command line information to CLI11 + * + * @param argc from int main(int argc, char ** argv) + * @param argv from int main(int argc, char ** argv) + */ void Parse(int argc, const char *const *argv); - // TODO, Check if these are necessary + /** + * @brief Modifiable reference to CLI::App (CLI11) + */ CLI::App &Ref() { return app_; } + + /** + * @brief Constant reference to CLI::App (CLI11) + */ const CLI::App &ConstRef() const { return app_; } // Setters @@ -106,8 +118,14 @@ class Args { ArgToolchain &out, const ArgToolchain &initial = ArgToolchain()); - // NOTE, Incomplete TargetArg - // TODO, Update for pch_compile_command + /** + * @brief Add Target config commands with a unique name and description + * + * @param out Receive the target command information through the CLI + * @param initial Set the default target command information as a fallback + * + * TODO, Update with other options for TargetConfig + */ void AddTarget(const std::string &name, const std::string &description, ArgTarget &out, const ArgTarget &initial = ArgTarget()); diff --git a/docs/source/user_api/args.rst b/docs/source/user_api/args.rst index 1e37cf41..f0e47702 100644 --- a/docs/source/user_api/args.rst +++ b/docs/source/user_api/args.rst @@ -4,3 +4,64 @@ Args args.h ------- +.. doxygenclass:: buildcc::Args + +.. doxygenstruct:: buildcc::ArgToolchainState + +.. doxygenstruct:: buildcc::ArgToolchain + +.. doxygenstruct:: buildcc::ArgTarget + +Example +--------- + +.. code-block:: cpp + :linenos: + + int main(int argc, char ** argv) { + Args args; + ArgToolchain arg_gcc_toolchain; + args.AddToolchain("gcc", "Generic GCC toolchain", arg_gcc_toolchain); + + // TODO, Add ArgTarget example (Currently incomplete) + args.Parse(argc, argv); + + // Root + args.GetProjectRootDir(); // Contains ``root_dir`` value + args.GetProjectBuildDir(); // Contains ``build_dir`` value + args.GetLogLevel(); // Contains ``loglevel`` enum + args.Clean(); // Contains ``clean`` value + + // Toolchain + arg_gcc_toolchain.state; // .build, .test + BaseToolchain gcc_toolchain = arg_gcc_toolchain.ConstructToolchain(); // .id, .name, .asm_compiler, .c_compiler, .cpp_compiler, .archiver, .linker + + // Underlying CLI11 library + auto & app = args.Ref(); + const auto & app = args.ConstRef(); + + return 0; + } + +.. code-block:: toml + :linenos: + + # Root + root_dir = "" + build_dir = "_build" + loglevel = "trace" + clean = true + + # Toolchain + [toolchain.gcc] + build = true + test = true + + id = "gcc" + name = "x86_64-linux-gnu" + asm_compiler = "as" + c_compiler = "gcc" + cpp_compiler = "g++" + archiver = "ar" + linker = "ld" + From 3b6c848c2ff9706e5ae09e1b20d730c694f8a962 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 02:20:48 -0800 Subject: [PATCH 04/18] Updated args --- buildcc/lib/args/include/args/args.h | 4 ++++ docs/source/user_api/args.rst | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/buildcc/lib/args/include/args/args.h b/buildcc/lib/args/include/args/args.h index d9cdd635..b57e2a6a 100644 --- a/buildcc/lib/args/include/args/args.h +++ b/buildcc/lib/args/include/args/args.h @@ -57,6 +57,10 @@ struct ArgToolchain { c_compiler(initial_c_compiler), cpp_compiler(initial_cpp_compiler), archiver(initial_archiver), linker(initial_linker) {} + /** + * @brief Construct a BaseToolchain from the arguments supplied through the + * command line information + */ BaseToolchain ConstructToolchain() const { BaseToolchain toolchain(id, name, asm_compiler, c_compiler, cpp_compiler, archiver, linker); diff --git a/docs/source/user_api/args.rst b/docs/source/user_api/args.rst index f0e47702..f0379258 100644 --- a/docs/source/user_api/args.rst +++ b/docs/source/user_api/args.rst @@ -4,14 +4,13 @@ Args args.h ------- -.. doxygenclass:: buildcc::Args +.. doxygenclass:: buildcc::Args + :members: Parse, Ref, ConstRef, AddToolchain, Clean, GetLogLevel, GetProjectRootDir, GetProjectBuildDir .. doxygenstruct:: buildcc::ArgToolchainState .. doxygenstruct:: buildcc::ArgToolchain -.. doxygenstruct:: buildcc::ArgTarget - Example --------- From af0fcc33692b1ac37b99fb19e4ed70645cee85c0 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 11:40:11 -0800 Subject: [PATCH 05/18] Update args.rst --- docs/source/user_api/args.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/user_api/args.rst b/docs/source/user_api/args.rst index f0379258..59cefc63 100644 --- a/docs/source/user_api/args.rst +++ b/docs/source/user_api/args.rst @@ -32,8 +32,10 @@ Example args.Clean(); // Contains ``clean`` value // Toolchain - arg_gcc_toolchain.state; // .build, .test - BaseToolchain gcc_toolchain = arg_gcc_toolchain.ConstructToolchain(); // .id, .name, .asm_compiler, .c_compiler, .cpp_compiler, .archiver, .linker + // .build, .test + arg_gcc_toolchain.state; + // .id, .name, .asm_compiler, .c_compiler, .cpp_compiler, .archiver, .linker -> BaseToolchain + BaseToolchain gcc_toolchain = arg_gcc_toolchain.ConstructToolchain(); // Underlying CLI11 library auto & app = args.Ref(); From 0a773b6cb662e52a8e9edd825a9cf9703792ce5f Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 11:57:50 -0800 Subject: [PATCH 06/18] Update register.h --- buildcc/lib/args/include/args/register.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/buildcc/lib/args/include/args/register.h b/buildcc/lib/args/include/args/register.h index 906641d5..92f19016 100644 --- a/buildcc/lib/args/include/args/register.h +++ b/buildcc/lib/args/include/args/register.h @@ -46,8 +46,8 @@ class Register { * Can be used to organize code into functional chunks */ template - void Callback(const C &build_cb, Params &...params) { - build_cb(std::forward(params)...); + void Callback(const C &build_cb, Params &&...params) { + build_cb(std::forward(params)...); } /** @@ -57,9 +57,9 @@ class Register { */ template void CallbackIf(const ArgToolchainState &toolchain_state, const C &build_cb, - Params &...params) { + Params &&...params) { if (toolchain_state.build) { - Callback(build_cb, std::forward(params)...); + Callback(build_cb, std::forward(params)...); } } @@ -68,15 +68,15 @@ class Register { */ template void Build(const ArgToolchainState &toolchain_state, const C &build_cb, - base::Target &target, Params &...params) { + base::Target &target, Params &&...params) { tf::Task task; CallbackIf( toolchain_state, - [&](base::Target <arget, Params &...lparams) { - build_cb(ltarget, std::forward(lparams)...); + [&](base::Target <arget, Params &&...lparams) { + build_cb(ltarget, std::forward(lparams)...); task = BuildTargetTask(ltarget); }, - target, std::forward(params)...); + target, std::forward(params)...); BuildStoreTask(target.GetUniqueId(), task); } @@ -84,8 +84,9 @@ class Register { * @brief Register the generator to be built */ template - void Build(const C &build_cb, base::Generator &generator, Params &...params) { - build_cb(generator, std::forward(params)...); + void Build(const C &build_cb, base::Generator &generator, + Params &&...params) { + build_cb(generator, std::forward(params)...); tf::Task task = BuildGeneratorTask(generator); BuildStoreTask(generator.GetUniqueId(), task); } From 714743f83f3afb0050daf01eaadd271e496ac1e3 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 11:57:59 -0800 Subject: [PATCH 07/18] Update args.rst --- docs/source/user_api/args.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user_api/args.rst b/docs/source/user_api/args.rst index 59cefc63..383268c7 100644 --- a/docs/source/user_api/args.rst +++ b/docs/source/user_api/args.rst @@ -5,7 +5,7 @@ args.h ------- .. doxygenclass:: buildcc::Args - :members: Parse, Ref, ConstRef, AddToolchain, Clean, GetLogLevel, GetProjectRootDir, GetProjectBuildDir + :members: Args, Parse, Ref, ConstRef, AddToolchain, Clean, GetLogLevel, GetProjectRootDir, GetProjectBuildDir .. doxygenstruct:: buildcc::ArgToolchainState From 4ff6902d30fb9238193f5c5156bb0428ce4ff45e Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 11:58:02 -0800 Subject: [PATCH 08/18] Update register.rst --- docs/source/user_api/register.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/user_api/register.rst b/docs/source/user_api/register.rst index 75c7f497..12f56e30 100644 --- a/docs/source/user_api/register.rst +++ b/docs/source/user_api/register.rst @@ -1,6 +1,8 @@ Register ========= - register.h ----------- + +.. doxygenclass:: buildcc::Register + :members: Register, Clean, Callback, Build, Dep, Test, RunBuild, RunTest From cff9605067a53f046d1a646584e6b1631c46df9a Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 12:21:08 -0800 Subject: [PATCH 09/18] Update register.rst --- docs/source/user_api/register.rst | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/source/user_api/register.rst b/docs/source/user_api/register.rst index 12f56e30..17b0f14b 100644 --- a/docs/source/user_api/register.rst +++ b/docs/source/user_api/register.rst @@ -6,3 +6,35 @@ register.h .. doxygenclass:: buildcc::Register :members: Register, Clean, Callback, Build, Dep, Test, RunBuild, RunTest + + +Example +-------- + +.. code-block:: cpp + :linenos: + + class BigObj {}; + + static void callback_usage_func(const BigObj & cobj, BigObj & obj); + + int main(int argc, char ** argv) { + Args args; + args.Parse(argc, argv); + + Register reg(args); + reg.Clean([](){ + fs::remove_all(env::get_project_build_dir()); + }); + + BigObj obj; + reg.Callback(callback_usage_func, BigObj(), obj); + + // Example snippets of these given in Target API + // Build + // Dep + // Test + // RunBuild + // RunTest + return 0; + } From 5366114ac6995715d1ff9b5867429a1e8179bb7d Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 12:27:16 -0800 Subject: [PATCH 10/18] Added new CallbackIf API --- buildcc/lib/args/include/args/register.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/buildcc/lib/args/include/args/register.h b/buildcc/lib/args/include/args/register.h index 92f19016..0a5369a0 100644 --- a/buildcc/lib/args/include/args/register.h +++ b/buildcc/lib/args/include/args/register.h @@ -50,6 +50,18 @@ class Register { build_cb(std::forward(params)...); } + /** + * @brief Generic register callback that is run when `expression == + * true` + * Can be used to add Toolchain-Target specific information + */ + template + void CallbackIf(bool expression, const C &build_cb, Params &&...params) { + if (expression) { + Callback(build_cb, std::forward(params)...); + } + } + /** * @brief Generic register callback that is run when `toolchain_state.build == * true` @@ -58,9 +70,8 @@ class Register { template void CallbackIf(const ArgToolchainState &toolchain_state, const C &build_cb, Params &&...params) { - if (toolchain_state.build) { - Callback(build_cb, std::forward(params)...); - } + CallbackIf(toolchain_state.build, build_cb, + std::forward(params)...); } /** From e877a5eea8bda2e2e3067df2959b717b64089ec3 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 12:27:19 -0800 Subject: [PATCH 11/18] Update register.rst --- docs/source/user_api/register.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/user_api/register.rst b/docs/source/user_api/register.rst index 17b0f14b..fb85eaee 100644 --- a/docs/source/user_api/register.rst +++ b/docs/source/user_api/register.rst @@ -5,7 +5,7 @@ register.h ----------- .. doxygenclass:: buildcc::Register - :members: Register, Clean, Callback, Build, Dep, Test, RunBuild, RunTest + :members: Register, Clean, Callback, CallbackIf, Build, Dep, Test, RunBuild, RunTest Example @@ -30,6 +30,9 @@ Example BigObj obj; reg.Callback(callback_usage_func, BigObj(), obj); + bool expression = true; // false + reg.CallbackIf(expression, callback_usage_func, BigObj(), obj); + // Example snippets of these given in Target API // Build // Dep From 7db23204e4ae9cb0ff5a7b26cc7a1bfcb4764da2 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 18:19:06 -0800 Subject: [PATCH 12/18] Update register.h --- buildcc/lib/args/include/args/register.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/buildcc/lib/args/include/args/register.h b/buildcc/lib/args/include/args/register.h index 0a5369a0..5fff18f0 100644 --- a/buildcc/lib/args/include/args/register.h +++ b/buildcc/lib/args/include/args/register.h @@ -79,11 +79,11 @@ class Register { */ template void Build(const ArgToolchainState &toolchain_state, const C &build_cb, - base::Target &target, Params &&...params) { + BaseTarget &target, Params &&...params) { tf::Task task; CallbackIf( toolchain_state, - [&](base::Target <arget, Params &&...lparams) { + [&](BaseTarget <arget, Params &&...lparams) { build_cb(ltarget, std::forward(lparams)...); task = BuildTargetTask(ltarget); }, @@ -95,8 +95,7 @@ class Register { * @brief Register the generator to be built */ template - void Build(const C &build_cb, base::Generator &generator, - Params &&...params) { + void Build(const C &build_cb, BaseGenerator &generator, Params &&...params) { build_cb(generator, std::forward(params)...); tf::Task task = BuildGeneratorTask(generator); BuildStoreTask(generator.GetUniqueId(), task); @@ -119,7 +118,7 @@ class Register { * Target is added as the `{executable}` argument */ void Test(const ArgToolchainState &toolchain_state, - const std::string &command, const base::Target &target, + const std::string &command, const BaseTarget &target, const TestConfig &config = TestConfig()); /** @@ -147,8 +146,8 @@ class Register { void Env(); // BuildTasks - tf::Task BuildTargetTask(base::Target &target); - tf::Task BuildGeneratorTask(base::Generator &generator); + tf::Task BuildTargetTask(BaseTarget &target); + tf::Task BuildGeneratorTask(BaseGenerator &generator); void BuildStoreTask(const std::string &unique_id, const tf::Task &task); private: From 3d74c74874a735d4d2f06441a05d424588fc69e1 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 19:50:30 -0800 Subject: [PATCH 13/18] Update test_info.h --- buildcc/lib/args/include/args/register/test_info.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/buildcc/lib/args/include/args/register/test_info.h b/buildcc/lib/args/include/args/register/test_info.h index 033a8f1c..c46b5359 100644 --- a/buildcc/lib/args/include/args/register/test_info.h +++ b/buildcc/lib/args/include/args/register/test_info.h @@ -26,12 +26,12 @@ namespace buildcc { struct TestOutput { enum class Type { - DefaultBehaviour, // Do not redirect to user or tests, default printed on - // console - TestPrintOnStderr, // Test only redirects stderr and prints - TestPrintOnStdout, // Test only redirects stdout and prints - TestPrintOnStderrAndStdout, // Test redirects both and prints - UserRedirect, // Redirects to user + DefaultBehaviour, ///< Do not redirect to user or tests, default printed on + ///< console + TestPrintOnStderr, ///< Test only redirects stderr and prints + TestPrintOnStdout, ///< Test only redirects stdout and prints + TestPrintOnStderrAndStdout, ///< Test redirects both and prints + UserRedirect, ///< Redirects to user variables }; TestOutput(Type output_type = Type::TestPrintOnStderrAndStdout, From 36f5da3b69d22974805bd941b83c5ed698e2912e Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 19:50:50 -0800 Subject: [PATCH 14/18] Update register.rst --- docs/source/user_api/register.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/source/user_api/register.rst b/docs/source/user_api/register.rst index fb85eaee..5eae7889 100644 --- a/docs/source/user_api/register.rst +++ b/docs/source/user_api/register.rst @@ -8,6 +8,15 @@ register.h :members: Register, Clean, Callback, CallbackIf, Build, Dep, Test, RunBuild, RunTest +test_info.h +------------- + +.. doxygenstruct:: buildcc::TestOutput + +.. doxygenstruct:: buildcc::TestConfig + +.. doxygenstruct:: buildcc::TestInfo + Example -------- From 885b31e58f9ef5f9789865f69b2a6ce61762ff5d Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 20:25:26 -0800 Subject: [PATCH 15/18] Updated register --- .../lib/args/include/args/register/test_info.h | 16 ++++++++++++++++ docs/source/user_api/register.rst | 4 +--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/buildcc/lib/args/include/args/register/test_info.h b/buildcc/lib/args/include/args/register/test_info.h index c46b5359..d2643d31 100644 --- a/buildcc/lib/args/include/args/register/test_info.h +++ b/buildcc/lib/args/include/args/register/test_info.h @@ -34,6 +34,13 @@ struct TestOutput { UserRedirect, ///< Redirects to user variables }; + /** + * @brief Configure your Reg::Test to get test output + * + * @param output_type Select your output type (behaviour) + * @param redirect_stdout User stdout redirection + * @param redirect_stderr User stderr redirection + */ TestOutput(Type output_type = Type::TestPrintOnStderrAndStdout, std::vector *redirect_stdout = nullptr, std::vector *redirect_stderr = nullptr) @@ -56,6 +63,13 @@ struct TestOutput { struct TestConfig { public: + /** + * @brief Configure your Reg::Test using TestConfig + * + * @param arguments fmt::format args passed to test commands + * @param working_directory Working directory from which the test runs + * @param output Output from tests + */ TestConfig( const std::unordered_map &arguments = {}, const std::optional &working_directory = {}, @@ -77,6 +91,8 @@ struct TestConfig { TestOutput output_; }; +// PRIVATE + struct TestInfo { TestInfo(const BaseTarget &target, const std::string &command, const TestConfig &config = TestConfig()) diff --git a/docs/source/user_api/register.rst b/docs/source/user_api/register.rst index 5eae7889..77033451 100644 --- a/docs/source/user_api/register.rst +++ b/docs/source/user_api/register.rst @@ -11,11 +11,9 @@ register.h test_info.h ------------- -.. doxygenstruct:: buildcc::TestOutput - .. doxygenstruct:: buildcc::TestConfig -.. doxygenstruct:: buildcc::TestInfo +.. doxygenstruct:: buildcc::TestOutput Example -------- From dc6d20fa525133284b5f92e0ce1f73379704b19d Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 20:28:30 -0800 Subject: [PATCH 16/18] Updated documentation --- buildcc/lib/args/include/args/register.h | 7 +++++-- buildcc/lib/args/include/args/register/test_info.h | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/buildcc/lib/args/include/args/register.h b/buildcc/lib/args/include/args/register.h index 5fff18f0..b34b4ce1 100644 --- a/buildcc/lib/args/include/args/register.h +++ b/buildcc/lib/args/include/args/register.h @@ -113,9 +113,12 @@ class Register { /** * @brief Register the Target to be run * PreReq: Call `Register::Build` before calling `Register::Test` - * PreReq: Requires toolchain_state.build && test to be true + * PreReq: Requires ArgToolchainState::build && ArgToolchainState::test to be + * true * - * Target is added as the `{executable}` argument + * Target is added as the `{executable}` argument. + * We can add more fmt::format arguments using the TestConfig arguments + * parameter */ void Test(const ArgToolchainState &toolchain_state, const std::string &command, const BaseTarget &target, diff --git a/buildcc/lib/args/include/args/register/test_info.h b/buildcc/lib/args/include/args/register/test_info.h index d2643d31..50d61f41 100644 --- a/buildcc/lib/args/include/args/register/test_info.h +++ b/buildcc/lib/args/include/args/register/test_info.h @@ -35,7 +35,7 @@ struct TestOutput { }; /** - * @brief Configure your Reg::Test to get test output + * @brief Configure your Register::Test to get test output * * @param output_type Select your output type (behaviour) * @param redirect_stdout User stdout redirection @@ -64,7 +64,7 @@ struct TestOutput { struct TestConfig { public: /** - * @brief Configure your Reg::Test using TestConfig + * @brief Configure your Register::Test using TestConfig * * @param arguments fmt::format args passed to test commands * @param working_directory Working directory from which the test runs From 8450671474e03db7c6d41f5c871c7ce3e783c980 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 21:52:37 -0800 Subject: [PATCH 17/18] Update supported_plugins.rst --- docs/source/user_api/supported_plugins.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/source/user_api/supported_plugins.rst b/docs/source/user_api/supported_plugins.rst index 4f178a0c..87204809 100644 --- a/docs/source/user_api/supported_plugins.rst +++ b/docs/source/user_api/supported_plugins.rst @@ -3,3 +3,19 @@ Supported Plugins clang_compile_commands.h ------------------------ + +.. doxygenclass:: buildcc::plugin::ClangCompileCommands + +Example +-------- + +.. code-block:: cpp + :linenos: + + using namespace buildcc; + + Target foolib; + Target hello_world; + + // Foolib and Hello world targets are both added to a single "compile_commands.json" file + plugin::ClangCompileCommands({&foolib, &hello_world}).Generate(); From bc398efdbb1d18c3d7c455ff106d8f7728529c44 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Sat, 15 Jan 2022 22:09:23 -0800 Subject: [PATCH 18/18] Update linux_gcc_cmake_build.yml --- .github/workflows/linux_gcc_cmake_build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linux_gcc_cmake_build.yml b/.github/workflows/linux_gcc_cmake_build.yml index 5d327756..4b25ca9c 100644 --- a/.github/workflows/linux_gcc_cmake_build.yml +++ b/.github/workflows/linux_gcc_cmake_build.yml @@ -162,7 +162,7 @@ jobs: - name: System Packages run: | - sudo apt-get install ninja-build doxygen graphviz gcovr cppcheck clang-tidy + sudo apt-get install ninja-build doxygen graphviz cppcheck clang-tidy - name: Install LCOV run: | @@ -179,7 +179,6 @@ jobs: clang --version ninja --version doxygen --version - gcovr --version cppcheck --version clang-tidy --version