<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>printfdebugging - build-system</title>
    <subtitle>Sahil Gautam&#x27;s Blog</subtitle>
    <link rel="self" type="application/atom+xml" href="https://printfdebugging.in/tags/build-system/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://printfdebugging.in/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-07-01T00:00:00+00:00</updated>
    <id>https://printfdebugging.in/tags/build-system/atom.xml</id>
    <entry xml:lang="en">
        <title>Build System Migration - Meson + Autotools + CMake = PkgConfig!</title>
        <published>2026-07-01T00:00:00+00:00</published>
        <updated>2026-07-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://printfdebugging.in/TextEditor/0002-build-system-migration/"/>
        <id>https://printfdebugging.in/TextEditor/0002-build-system-migration/</id>
        
        <content type="html" xml:base="https://printfdebugging.in/TextEditor/0002-build-system-migration/">&lt;h1 id=&quot;the-problem&quot;&gt;The Problem&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;What happens when you use one build system and try to use libraries with another build system?
&lt;ul&gt;
&lt;li&gt;CMake can&#x27;t include Meson projects&lt;&#x2F;li&gt;
&lt;li&gt;Meson can&#x27;t include Autotools projects&lt;&#x2F;li&gt;
&lt;li&gt;Autotools + Make doesn&#x27;t generate a &lt;code&gt;compile_commands.json&lt;&#x2F;code&gt; file&lt;&#x2F;li&gt;
&lt;li&gt;Custom scripts in build system specific scripting languages get ugly quite quickly&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;potential-ways-to-fix-it&quot;&gt;Potential Ways to Fix it&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The Better One of the Bunch - &lt;strong&gt;Meson&lt;&#x2F;strong&gt;!&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;It &lt;em&gt;can integrate&lt;&#x2F;em&gt; CMake projects&lt;&#x2F;li&gt;
&lt;li&gt;It &lt;em&gt;can build&lt;&#x2F;em&gt; Autotools projects as one would do manually with some custom scripting (haven&#x27;t tried it myself).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;How build systems talk to each other&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;There&#x27;s no standard way to do it at build time&lt;&#x2F;li&gt;
&lt;li&gt;Each build system supports &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.freedesktop.org&#x2F;wiki&#x2F;Software&#x2F;pkg-config&#x2F;&quot;&gt;pkgconfig&lt;&#x2F;a&gt;, so the installed artifacts can be consumed through that interface.&lt;&#x2F;li&gt;
&lt;li&gt;It is build system agnostic, so as long as a &lt;code&gt;.pc&lt;&#x2F;code&gt; file is generated, we can consume that project.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;CollaboraOnline&#x2F;online.mirror&#x2F;tree&#x2F;main&#x2F;engine&quot;&gt;CollaboraOffice&lt;&#x2F;a&gt; uses this approach to consume external libraries (with some Make metaprogramming)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;the-migration-process&quot;&gt;The Migration Process&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;data-code-separation&quot;&gt;Data &amp;amp; Code Separation&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Architectural overview
&lt;ul&gt;
&lt;li&gt;The configure &amp;amp; build commands are pretty standard for any build system&lt;&#x2F;li&gt;
&lt;li&gt;The only thing which changes is the configure options. We separated them from the build commands.&lt;&#x2F;li&gt;
&lt;li&gt;For each exteral project &lt;em&gt;foo&lt;&#x2F;em&gt;, there are 4 config files, &lt;code&gt;config&#x2F;external&#x2F;foo&#x2F;flags.{common,linux,apple,windows}&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;These contain the configure flags for the specific build system.&lt;&#x2F;li&gt;
&lt;li&gt;We then have a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;printfdebugging&#x2F;graphics&#x2F;blob&#x2F;main&#x2F;scripts&#x2F;make&#x2F;exports.mk&quot;&gt;&lt;code&gt;scripts&#x2F;make&#x2F;exports.mk&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; script which looks like this...&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #ABB2BF); background-color: light-dark(#FFFFFF, #282C34);&quot;&gt;&lt;code data-lang=&quot;make&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt;#&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt; scripts&#x2F;make&#x2F;exports.mk&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;EXTERNALS&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;shell&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; realpath .&#x2F;external&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 3&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;EXTERNALS_CONFIG&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;shell&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; realpath .&#x2F;config&#x2F;external&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 4&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;INSTALL_DIRECTORY&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;shell&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; realpath .&#x2F;install&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 5&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;BUILD_DIRECTORY&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;shell&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; realpath .&#x2F;build&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 6&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;CLANGD_CONFIG&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;shell&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; realpath .&#x2F;.clangd&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 7&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;PLATFORM&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;shell&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; uname -s&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;MESON_BUILD_TYPE&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt; debug&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 9&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;CMAKE_BUILD_TYPE&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt; Debug&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;10&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;SHELL&lt;&#x2F;span&gt;&lt;span&gt; :=&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt; &#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;11&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;12&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;ifeq&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;PLATFORM&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;Linux)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;13&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	PLATFORM_CONFIG_EXTENSION = linu&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;x&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;14&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;else ifeq&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;PLATFORM&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;Darwin)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;15&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	PLATFORM_CONFIG_EXTENSION = appl&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;16&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;else ifeq&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;PLATFORM&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;MINGW64*)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;17&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	PLATFORM_CONFIG_EXTENSION = window&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;18&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;19&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	PLATFORM_CONFIG_EXTENSION = unknow&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;n&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;20&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;endif&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;About exports.mk&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Here we define some paths and some variables which would be used in the build scripts&lt;&#x2F;li&gt;
&lt;li&gt;Platform detection sets the flags file extension which we need to include other than &lt;code&gt;flags.common&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Make metaprogramming&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The metaprograms define build wrappers in &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;printfdebugging&#x2F;graphics&#x2F;blob&#x2F;main&#x2F;scripts&#x2F;make&#x2F;build_wrappers.mk&quot;&gt;&lt;code&gt;scripts&#x2F;make&#x2F;build_wrappers.mk&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; and eval call them from &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;printfdebugging&#x2F;graphics&#x2F;blob&#x2F;main&#x2F;Makefile&quot;&gt;&lt;code&gt;Makefile&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;There&#x27;s one for Meson, Autotools and CMake&lt;&#x2F;li&gt;
&lt;li&gt;For a project &lt;code&gt;foo&lt;&#x2F;code&gt;, we generate &lt;code&gt;foo&lt;&#x2F;code&gt;, &lt;code&gt;foo.configure&lt;&#x2F;code&gt;, &lt;code&gt;foo.build&lt;&#x2F;code&gt;, &lt;code&gt;foo.clangd&lt;&#x2F;code&gt;, &lt;code&gt;foo.install&lt;&#x2F;code&gt; and &lt;code&gt;foo.clean&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;We get the common and platform specific configure flags from the flag files in &lt;code&gt;config&#x2F;external&#x2F;foo&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Target &lt;code&gt;foo&lt;&#x2F;code&gt; depends on all those &lt;code&gt;foo&lt;&#x2F;code&gt; prefixed targets&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #ABB2BF); background-color: light-dark(#FFFFFF, #282C34);&quot;&gt;&lt;code data-lang=&quot;make&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt;#&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt; scripts&#x2F;make&#x2F;build_wrappers.mk&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;define&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt; build_wrapper_cmake&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 3&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;_CONFIGURE_FLAGS=&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(shell cat &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(EXTERNALS_CONFIG)&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;&#x2F;{flags.common,flags.&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(PLATFORM_CONFIG_EXTENSION)} | xargs)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 5&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.configure &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.build &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.install &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.clangd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 7&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.configure:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	cmake \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 9&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		-DCMAKE_BUILD_TYPE=&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(CMAKE_BUILD_TYPE) \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;10&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		-DCMAKE_INSTALL_PREFIX=&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(INSTALL_DIRECTORY) \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;11&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;12&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;		$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;_CONFIGURE_FLAGS) \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;13&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		-B &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(BUILD_DIRECTORY)&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;&amp;quot; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;14&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		-S &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(EXTERNALS)&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;15&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;16&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.build:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;17&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	cmake --build &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(BUILD_DIRECTORY)&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;18&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;19&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.clangd:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;20&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;	$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(call clangd_config_string,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(BUILD_DIRECTORY)&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;21&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;22&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.install:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;23&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	cmake --install &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(BUILD_DIRECTORY)&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;&amp;quot; --prefix &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(INSTALL_DIRECTORY)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;24&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;25&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.clean:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;26&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	rm -rf &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #E5C07B);&quot;&gt;$$&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;(BUILD_DIRECTORY)&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;27&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;endef&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;28&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #ABB2BF); background-color: light-dark(#FFFFFF, #282C34);&quot;&gt;&lt;code data-lang=&quot;make&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt;#&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt; Makefile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; build_wrapper_meson&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;fontconfig&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 3&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; build_wrapper_cmake&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;cglm&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 4&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; build_wrapper_cmake&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;freetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 5&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; build_wrapper_meson&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;harfbuzz&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 6&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; build_wrapper_cmake&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;glfw&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 7&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; build_wrapper_cmake&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;glad&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; build_wrapper_autotools&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;ffmpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;a-note-on-clangd-integration&quot;&gt;A Note on Clangd integration&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Clangd &amp;amp; CompDB&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;By default, it looks for &lt;code&gt;compile_commands.json&lt;&#x2F;code&gt; file in the project root and the &lt;code&gt;build&#x2F;&lt;&#x2F;code&gt; directory&lt;&#x2F;li&gt;
&lt;li&gt;External projects generate the compdb in their respective build directories&lt;&#x2F;li&gt;
&lt;li&gt;Compdb file generated with Meson + Ninja has relative paths, so it&#x27;s good only if read from the build directory&lt;&#x2F;li&gt;
&lt;li&gt;So we can&#x27;t merge multiple compdb files into one, that would unnecessarily complicate things&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;One way is to use an &lt;em&gt;external tool&lt;&#x2F;em&gt; like &lt;code&gt;bear&lt;&#x2F;code&gt; to wrap all the build commands &amp;amp; append their compdb files&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;This is actually not that impractical since we have to do that for Autotools projects anyways&lt;&#x2F;li&gt;
&lt;li&gt;Also bear is available on all major desktop platforms.&lt;&#x2F;li&gt;
&lt;li&gt;I did this &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;printfdebugging&#x2F;graphics&#x2F;blob&#x2F;7b284ff04521e546df86bddb2b8065a1c5ee6f23&#x2F;scripts&#x2F;externals.sh&quot;&gt;successfully&lt;&#x2F;a&gt; some time ago in bash. I had to create a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;printfdebugging&#x2F;graphics&#x2F;blob&#x2F;7b284ff04521e546df86bddb2b8065a1c5ee6f23&#x2F;bear.yml&quot;&gt;config file&lt;&#x2F;a&gt; for bear.&lt;&#x2F;li&gt;
&lt;li&gt;If this works for you, it&#x27;s not a bad solution. But since I had to redo it, I was looking for something better&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Clangd configuration&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;We can set &lt;code&gt;CompileFlags.CompilationDatabase&lt;&#x2F;code&gt; in &lt;code&gt;.clangd&lt;&#x2F;code&gt; to tell clang where to look for the compdb file&lt;&#x2F;li&gt;
&lt;li&gt;But this is only for a single compdb file, we have many of them in different build directories&lt;&#x2F;li&gt;
&lt;li&gt;We can use pattern matching and conditionally change the &lt;code&gt;CompilationDatabase&lt;&#x2F;code&gt; path
&lt;ul&gt;
&lt;li&gt;This was suggested by &lt;a href=&quot;https:&#x2F;&#x2F;printfdebugging.in&#x2F;TextEditor&#x2F;0002-build-system-migration&#x2F;@_oftc_Arsen:matrix.org&quot;&gt;Arsen&lt;&#x2F;a&gt; on the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;matrix.to&#x2F;#&#x2F;#mesonbuild:matrix.org&quot;&gt;mesonbuild matrix channel&lt;&#x2F;a&gt;, thanks!&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;clangd.llvm.org&#x2F;config#compilationdatabase&quot;&gt;Configuration - CompilationDatabase&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;clangd.llvm.org&#x2F;config#if&quot;&gt;Configuration - If&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.managarm.org&#x2F;handbook&#x2F;contributing&#x2F;lsp.html#note-on-multi-build-sources&quot;&gt;LSP setup - Managarm Handbook&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;This solution is elegant and we can integrate this with some metaprogramming&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#24292E, #ABB2BF); background-color: light-dark(#FFFFFF, #282C34);&quot;&gt;&lt;code data-lang=&quot;make&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt;#&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt; scripts&#x2F;make&#x2F;build_wrappers.mk&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;define&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt; clangd_config_string&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 3&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	@touch &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;CLANGD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 4&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;	@if ! grep -q &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;CLANGD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;; then \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 5&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		{ echo &amp;quot;---&amp;quot;; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 6&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		  echo &amp;quot;If:&amp;quot;; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 7&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		  echo &amp;quot;  PathMatch: .*&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;1&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;.*&amp;quot;; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		  echo &amp;quot;CompileFlags:&amp;quot;; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt; 9&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		  echo &amp;quot;  CompilationDatabase: &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;2&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;&amp;quot;; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;10&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;		} | tee -a &lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;CLANGD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E5C07B);&quot;&gt;; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;11&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#D73A49, #C678DD);&quot;&gt;endef&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;12&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;13&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt;#&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6A737D, #7F848E);&quot;&gt; Makefile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;14&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#6F42C1, #61AFEF);&quot;&gt;clangd&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;15&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;	$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; clangd_config_string&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;engine&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;BUILD_DIRECTORY&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot; style=&quot;color: light-dark(#1B1F234D, #495162);&quot;&gt;16&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;	$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#005CC5, #56B6C2);&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt; clangd_config_string&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;projects&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#24292E, #E06C75);&quot;&gt;BUILD_DIRECTORY&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: light-dark(#032F62, #98C379);&quot;&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Clangd config generation
&lt;ul&gt;
&lt;li&gt;We grep from &lt;code&gt;.clangd&lt;&#x2F;code&gt; to avoid duplication&lt;&#x2F;li&gt;
&lt;li&gt;For each external library &lt;em&gt;foo&lt;&#x2F;em&gt; we generate &lt;code&gt;foo.clangd&lt;&#x2F;code&gt; where we call this metaprogram&lt;&#x2F;li&gt;
&lt;li&gt;This works!&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;advantages&quot;&gt;Advantages&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Officially supported build systems are always better
&lt;ul&gt;
&lt;li&gt;Harfbuzz had some &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;harfbuzz&#x2F;harfbuzz&#x2F;issues&#x2F;5683#issuecomment-3748839366&quot;&gt;issues&lt;&#x2F;a&gt; linking static libraries built with CMake. With Meson, it links just fine.&lt;&#x2F;li&gt;
&lt;li&gt;I don&#x27;t like to use LLMs, and manually writing&#x2F;maintaining build scripts is just not practical&lt;&#x2F;li&gt;
&lt;li&gt;Bash&#x2F;Make is easy to debug&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;ul&gt;
&lt;li&gt;Github PRs
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;printfdebugging&#x2F;graphics&#x2F;pull&#x2F;5&quot;&gt;build system migration by printfdebugging · Pull Request #5 · printfdebugging&#x2F;graphics&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;printfdebugging&#x2F;graphics&#x2F;pull&#x2F;6&quot;&gt;compilation database fixes by printfdebugging · Pull Request #6 · printfdebugging&#x2F;graphics&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
</feed>
