<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: BRATAN CORPORATION</title>
    <description>The latest articles on DEV Community by BRATAN CORPORATION (@bratan-corp).</description>
    <link>https://dev.to/bratan-corp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4276361%2F88273262-9eb2-4a2e-bd1b-00a4e57ef59e.jpg</url>
      <title>DEV Community: BRATAN CORPORATION</title>
      <link>https://dev.to/bratan-corp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bratan-corp"/>
    <language>en</language>
    <item>
      <title>What I check when switching CMake presets in VS Code</title>
      <dc:creator>BRATAN CORPORATION</dc:creator>
      <pubDate>Wed, 02 Dec 2026 15:22:31 +0000</pubDate>
      <link>https://dev.to/bratan-corp/what-i-check-when-switching-cmake-presets-in-vs-code-5cfc</link>
      <guid>https://dev.to/bratan-corp/what-i-check-when-switching-cmake-presets-in-vs-code-5cfc</guid>
      <description>&lt;p&gt;A CMake preset can change the compiler, language standard, include paths or definitions. If the editor is still reading a compilation database from the previous build directory, it may underline valid code or miss an error that the build catches. Here is a quick way to check where the two configurations diverge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find the database for the build you actually ran
&lt;/h2&gt;

&lt;p&gt;For a CMake project using Ninja, enable &lt;code&gt;CMAKE_EXPORT_COMPILE_COMMANDS&lt;/code&gt; and look for &lt;code&gt;compile_commands.json&lt;/code&gt; in the build directory. CLAP enables this export for &lt;code&gt;clap cmake .&lt;/code&gt;. In a local test of CLAP 0.43.0 on Ubuntu 26.04 under WSL, I confirmed that the generated sample contained both &lt;code&gt;build/build.ninja&lt;/code&gt; and &lt;code&gt;build/compile_commands.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Open the entry for the source file showing the problem. Check its working directory and look for one flag you expect the preset to change. A project-specific &lt;code&gt;-D&lt;/code&gt; definition is a good starting point. If the flag is missing from this database, inspect the CMake configuration and regenerate before changing editor settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Point the editor at that same file
&lt;/h2&gt;

&lt;p&gt;In VS Code with Microsoft’s C/C++ extension, check the &lt;strong&gt;Compile Commands&lt;/strong&gt; setting for the workspace folder that owns the file. When two presets use different build directories, make sure this setting points at the new database after switching. If both roots contain a file with the same name, use the full path to check which database entry you found.&lt;/p&gt;

&lt;p&gt;To test the connection, use a small source file with an &lt;code&gt;#ifdef&lt;/code&gt; for a macro that changes between presets. Build with each preset, switch the database, and check whether the editor marks the same branch active as you expect from the compiler flags. This is a proposed diagnostic exercise. The WSL check above verified database generation for the sample.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/BRATAN-CORP/clap/blob/main/docs/COMPILE_COMMANDS.md" rel="noopener noreferrer"&gt;CLAP compilation database notes&lt;/a&gt; · &lt;a href="https://code.visualstudio.com/docs/cpp/customize-cpp-settings" rel="noopener noreferrer"&gt;Microsoft C/C++ configuration reference&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was prepared with AI assistance.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>debugging</category>
      <category>softwaredevelopment</category>
      <category>vscode</category>
    </item>
    <item>
      <title>From a C++ build in the terminal to clickable errors in VS Code</title>
      <dc:creator>BRATAN CORPORATION</dc:creator>
      <pubDate>Wed, 02 Dec 2026 14:46:23 +0000</pubDate>
      <link>https://dev.to/bratan-corp/from-a-c-build-in-the-terminal-to-clickable-errors-in-vs-code-7og</link>
      <guid>https://dev.to/bratan-corp/from-a-c-build-in-the-terminal-to-clickable-errors-in-vs-code-7og</guid>
      <description>&lt;p&gt;A compiler error in a terminal tells you what failed. In VS Code I also want to jump straight to the failing line, use the normal build shortcut, and stop a long build without hunting for its process. That’s the workflow we built the CLAP Compiler extension around. Version 0.2.0 is now on the &lt;a href="https://marketplace.visualstudio.com/items?itemName=bratan-corp.clap-compiler" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it with a small C++ project
&lt;/h2&gt;

&lt;p&gt;Install the CLI from PyPI in your usual Python environment and create a sample project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m pip install clap-compiler
clap init hello --template cpp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the new &lt;code&gt;hello&lt;/code&gt; folder in VS Code and install &lt;strong&gt;CLAP Compiler&lt;/strong&gt;. If the editor can’t locate the CLI, set &lt;code&gt;clap.executablePath&lt;/code&gt; to the executable in that Python environment. To try the pinned Zig toolchain, run &lt;strong&gt;CLAP: Bootstrap Toolchain&lt;/strong&gt; from the Command Palette. Then run &lt;strong&gt;CLAP: Build&lt;/strong&gt;. The CLI handles the build. The extension invokes it and surfaces the result in the editor.&lt;/p&gt;

&lt;p&gt;Now introduce a syntax error in a source file and run &lt;strong&gt;CLAP: Build&lt;/strong&gt; from the Command Palette again. GCC/Clang and MSVC-style diagnostics with source locations appear in &lt;strong&gt;Problems&lt;/strong&gt;, where you can click through to the line. For keyboard-driven builds and tests, the extension also exposes native VS Code tasks. The Command Palette provides &lt;strong&gt;CLAP: Cancel Running Command&lt;/strong&gt; for active extension commands.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftgf4v0msvxzgoxzdn9a1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftgf4v0msvxzgoxzdn9a1.jpg" alt="A compiler diagnostic in VS Code" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the editor integration fits
&lt;/h2&gt;

&lt;p&gt;CLAP is a build frontend for existing C/C++ toolchains, and the extension works with the same CLI you can run in a terminal or CI. For a multi-root workspace, Palette commands normally target the folder containing the active editor. Builds can run in separate roots concurrently, while overlapping commands in the same root are guarded.&lt;/p&gt;

&lt;p&gt;If you try it on an existing CMake project, I’m interested in the first thing that gets in your way. Was it finding the CLI, picking the toolchain, or getting a compiler error into the Problems panel? The &lt;a href="https://github.com/BRATAN-CORP/clap/tree/main/editors/vscode" rel="noopener noreferrer"&gt;source and extension-host test instructions&lt;/a&gt; are on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was prepared with AI assistance.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cli</category>
      <category>cpp</category>
      <category>softwaredevelopment</category>
      <category>vscode</category>
    </item>
    <item>
      <title>A Reproducible C/C++ Toolchain Workflow with Zig, CMake, and Ninja</title>
      <dc:creator>BRATAN CORPORATION</dc:creator>
      <pubDate>Tue, 01 Dec 2026 12:10:25 +0000</pubDate>
      <link>https://dev.to/bratan-corp/a-reproducible-cc-toolchain-workflow-with-zig-cmake-and-ninja-4fg</link>
      <guid>https://dev.to/bratan-corp/a-reproducible-cc-toolchain-workflow-with-zig-cmake-and-ninja-4fg</guid>
      <description>&lt;h1&gt;
  
  
  A Reproducible C/C++ Toolchain Workflow with Zig, CMake, and Ninja
&lt;/h1&gt;

&lt;p&gt;Getting a small C or C++ program from source code to a running executable often involves more setup than the program itself. A compiler has to be installed, the right executable has to be found, CMake may need a generator, and the first error often says more about the machine than about the code.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://github.com/BRATAN-CORP/clap" rel="noopener noreferrer"&gt;CLAP&lt;/a&gt; to make that workflow explicit and repeatable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The basic workflow
&lt;/h2&gt;

&lt;p&gt;Install the Python package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m pip install clap-compiler
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run a C or C++ source file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;clap run main.c
clap run main.cpp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a project that already has a &lt;code&gt;CMakeLists.txt&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;clap cmake .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLAP keeps the single-file workflow and the CMake workflow behind the same command-line tool. The source repository contains examples for both paths.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Zig is part of the workflow
&lt;/h2&gt;

&lt;p&gt;CLAP can provision a pinned Zig toolchain when a compiler is needed. Zig is useful here because it provides a compiler frontend and a practical cross-target interface in one distribution. The point is to make the selected compiler visible and make the initial setup predictable.&lt;/p&gt;

&lt;p&gt;The diagnostic command reports the important paths and versions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clap doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output includes the CLAP version, target platform, selected compiler, Zig version, CMake path, and Ninja path. The downloaded toolchain is cached locally and verified before use.&lt;/p&gt;

&lt;h2&gt;
  
  
  CMake and Ninja
&lt;/h2&gt;

&lt;p&gt;A CMake project still gets a normal CMake configure and build. CLAP supplies the surrounding toolchain selection and uses Ninja as the build backend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;clap cmake examples/cmake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps the project structure familiar. Existing CMake files remain the source of build configuration, while CLAP handles the first-run compiler setup and the command-line entry point.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the first-run output should answer
&lt;/h2&gt;

&lt;p&gt;When a build fails on a new machine, users usually need answers to a few concrete questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which compiler was selected?&lt;/li&gt;
&lt;li&gt;Which target is being built?&lt;/li&gt;
&lt;li&gt;Where is the compiler located?&lt;/li&gt;
&lt;li&gt;Is CMake using the intended generator?&lt;/li&gt;
&lt;li&gt;Can the same command be repeated offline?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those questions shaped the &lt;code&gt;clap doctor&lt;/code&gt; output and the build messages. A compiler frontend is easier to debug when it reports the decisions it made instead of only printing the final subprocess error.&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows distribution
&lt;/h2&gt;

&lt;p&gt;The Python package works across the supported platforms. CLAP also has a portable Windows x64 build that bundles the executable, CMake, and Ninja. It is available through a project-owned Scoop bucket, and a WinGet package submission is in review.&lt;/p&gt;

&lt;p&gt;The Windows package can be installed with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;scoop&lt;/span&gt; &lt;span class="n"&gt;bucket&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;clap&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;BRATAN&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;CORP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;scoop&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;clap&lt;/span&gt;
&lt;span class="n"&gt;scoop&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;clap&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;clap&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;compiler&lt;/span&gt;
&lt;span class="n"&gt;clap&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;CLAP is MIT-licensed and available on GitHub at &lt;a href="https://github.com/BRATAN-CORP/clap" rel="noopener noreferrer"&gt;https://github.com/BRATAN-CORP/clap&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’m interested in feedback on the compiler-selection model, the diagnostics, and the boundary between a simple single-file command and a full CMake project workflow.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>cli</category>
      <category>programming</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
