MCPcopy Create free account
hub / github.com/build-cpp/cmkr / inject_cmake

Method inject_cmake

src/cmake_generator.cpp:534–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532 }
533
534 void inject_cmake(const std::string &cmake) {
535 if (!cmake.empty()) {
536 if (cmake.back() == '\"') {
537 throw std::runtime_error("Detected additional \" at the end of cmake block");
538 }
539 auto cmake_lf = tolf(cmake);
540 while (!cmake_lf.empty() && cmake_lf.back() == '\n')
541 cmake_lf.pop_back();
542 bool did_indent = false;
543 for (char ch : cmake_lf) {
544 if (!did_indent) {
545 ss << Command::indent(indent);
546 did_indent = true;
547 } else if (ch == '\n') {
548 did_indent = false;
549 }
550 ss << ch;
551 }
552 ss << '\n';
553 }
554 }
555
556 template <typename T, typename Lambda>
557 void handle_condition(const parser::Condition<T> &value, const Lambda &fn) {

Callers

nothing calls this directly

Calls 2

tolfFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected