diff --git a/.clang-format b/.clang-format index 09ec46b..39a0dad 100644 --- a/.clang-format +++ b/.clang-format @@ -13,6 +13,7 @@ AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: false AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false +AllowShortLambdasOnASingleLine: None AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false diff --git a/src/cmake_generator.cpp b/src/cmake_generator.cpp index 8153038..a657cb6 100644 --- a/src/cmake_generator.cpp +++ b/src/cmake_generator.cpp @@ -558,11 +558,15 @@ struct Generator { } void conditional_includes(const parser::ConditionVector &include) { - handle_condition(include, [this](const std::string &, const std::vector &includes) { inject_includes(includes); }); + handle_condition(include, [this](const std::string &, const std::vector &includes) { + inject_includes(includes); + }); } void conditional_cmake(const parser::Condition &cmake) { - handle_condition(cmake, [this](const std::string &, const std::string &cmake) { inject_cmake(cmake); }); + handle_condition(cmake, [this](const std::string &, const std::string &cmake) { + inject_cmake(cmake); + }); } bool if_condition(const std::string &condition) { @@ -719,9 +723,15 @@ void generate_cmake(const char *path, const parser::Project *parent_project) { // Helper lambdas for more convenient CMake generation auto &ss = gen.ss; - auto cmd = [&gen](const std::string &command) { return gen.cmd(command); }; - auto comment = [&gen](const std::string &comment) { return gen.comment(comment); }; - auto endl = [&gen]() { gen.endl(); }; + auto cmd = [&gen](const std::string &command) { + return gen.cmd(command); + }; + auto comment = [&gen](const std::string &comment) { + return gen.comment(comment); + }; + auto endl = [&gen]() { + gen.endl(); + }; std::string cmkr_url = "https://github.com/build-cpp/cmkr"; comment("This file is automatically generated from cmake.toml - DO NOT EDIT"); @@ -1145,7 +1155,9 @@ void generate_cmake(const char *path, const parser::Project *parent_project) { for (size_t i = 0; i < project.targets.size(); i++) { const auto &target = project.targets[i]; - auto throw_target_error = [&target](const std::string &message) { throw std::runtime_error("[target." + target.name + "] " + message); }; + auto throw_target_error = [&target](const std::string &message) { + throw std::runtime_error("[target." + target.name + "] " + message); + }; const parser::Template *tmplate = nullptr; std::unique_ptr tmplate_cs{}; @@ -1384,8 +1396,9 @@ void generate_cmake(const char *path, const parser::Project *parent_project) { } auto target_cmd = [&](const char *command, const parser::ConditionVector &cargs, const std::string &scope) { - gen.handle_condition(cargs, - [&](const std::string &, const std::vector &args) { cmd(command)(target.name, scope, args); }); + gen.handle_condition(cargs, [&](const std::string &, const std::vector &args) { + cmd(command)(target.name, scope, args); + }); }; auto gen_target_cmds = [&](const parser::Target &t) {