A hello world executable created using declarative CMakeSL format.
This file contains 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
// Requires google's benchmark library: https://github.com/google/benchmark | |
#include <benchmark/benchmark.h> | |
#include <cstdint> | |
constexpr auto k_samples_count = 1000000u; | |
uint8_t random_char() | |
{ |
tl;dr: CMakeSL is now able to build itself. Read along to find out what changes have been made since last reddit post and a short video from CMakeSL building.
- CMakeSL RSS - I'm going to reuse my page feed. I'm not going to post every article at
r/cpp
orr/cmake
, so if you want to be notified about new CMakeSL arts, the RSS is the only reliable way. - CMakeSL repo
This article is meant to present what's going on with the CMakeSL project. If you don't know what the CMakeSL is, check out this gist or the readme.
This file contains 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
diff --git a/tools/clang-format/ClangFormat.cpp b/tools/clang-format/ClangFormat.cpp | |
index 37c2d8b78f..ff71b4aac8 100644 | |
--- a/tools/clang-format/ClangFormat.cpp | |
+++ b/tools/clang-format/ClangFormat.cpp | |
@@ -22,6 +22,7 @@ | |
#include "clang/Rewrite/Core/Rewriter.h" | |
#include "llvm/Support/CommandLine.h" | |
#include "llvm/Support/FileSystem.h" | |
+#include "llvm/Support/Regex.h" | |
#include "llvm/Support/Signals.h" |
This file contains 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
for every listed file | |
for every passed regex | |
if file name match regex | |
format shit out |
This file contains 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
static cl::opt<bool> Recursively("r", | |
cl::desc("Recursively search for <file>s."), | |
cl::cat(ClangFormatCategory)); |
This file contains 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
if (Recursively) { | |
return clang::format::formatRecusively(); | |
} |
This file contains 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
static bool formatRecusively() { | |
std::vector<std::string> files; | |
if (checkMultipleFilesPreconditions() || findMatchingFiles(files)) { | |
return false; | |
} | |
bool Error = false; | |
for (unsigned i = 0; i < files.size(); ++i) { | |
Error |= clang::format::format(files[i]); |
NewerOlder