Meson: Use out-of-nothing GIT projects as dependencies
Meson project dependency processing: cleverly solves the problem of dependency on Git project without Meson.build files
Many excellent Git projects lack Meson.build files, which presents challenges for developers using Meson build systems. This article will introduce a way to solve this problem by creating a patch file and successfully add a Git project without the Meson.build file to your Meson project as a subproject.
Suppose you need to add benhoyt/ht
project (which does not have a Meson.build file) to your project as a subproject. You can use Meson's wrap
mechanism, but you need to add the Meson.build file manually.
First, create a ht.wrap
file and specify the Git repository information:
<code>[wrap-git] directory=ht url=https://github.com/benhoyt/ht revision=master depth=1</code>
Then, download the subproject:
<code class="bash">meson subprojects ht</code>
Next, create an empty meson.build
file in subprojects/ht
directory:
<code class="bash">touch ./subprojects/ht/meson.build</code>
Now, create a patch file containing the meson.build
file:
<code class="bash">mkdir -pv subprojects/{packagecache,packagefiles} git -C ./subprojects/ht add meson.build git -C ./subprojects/ht diff --cached > ./subprojects/packagefiles/ht-meson.patch</code>
Finally, add the patch file to the ht.wrap
file:
<code class="bash">echo "diff_files = ht-meson.patch" >> ./subprojects/ht.wrap</code>
Now you can run the Meson build system:
<code class="bash">CC=gcc meson setup ./build --wipe -D b_sanitize=none -D buildtype=release meson compile -C ./build</code>
After the compilation is successful, the executable file will appear in the ./build
directory.
Summary: By creating the meson.build
file and the corresponding patch, you can easily add a Git project without the Meson.build file to your Meson project as a subproject. This approach avoids modifying the original project and maintains the integrity of the project.
Reference information:
- Meson Subprojects: https://www.php.cn/link/aaddcd13798c7609e4c6479d1a4f67c9
- GCC 14.2.0: https://www.php.cn/link/9a912f218d27a625d946ed56081d9123
- Meson 1.7.0
- Ninja 1.12.1
- GNU Emacs 30
- Debian Sid
- GNU Guix
(Note: This article assumes that you have installed necessary tools such as Meson, GCC and Ninja. The content of the meson.build
file needs to be written according to the actual situation of the ht
project.)
The above is the detailed content of Meson: Use out-of-nothing GIT projects as dependencies. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Cryptocurrency data platforms suitable for beginners include CoinMarketCap and non-small trumpet. 1. CoinMarketCap provides global real-time price, market value, and trading volume rankings for novice and basic analysis needs. 2. The non-small quotation provides a Chinese-friendly interface, suitable for Chinese users to quickly screen low-risk potential projects.

Exchanges that support cross-chain transactions: 1. Binance, 2. Uniswap, 3. SushiSwap, 4. Curve Finance, 5. Thorchain, 6. 1inch Exchange, 7. DLN Trade, these platforms support multi-chain asset transactions through various technologies.

Git and GitHub are key tools for modern software development. Git provides version control capabilities to manage code through repositories, branches, commits and merges. GitHub provides code hosting and collaboration features such as Issues and PullRequests. Using Git and GitHub can significantly improve development efficiency and team collaboration capabilities.

The forecasts for the top 10 formal cryptocurrency trading platforms in the 2025 cryptocurrency trading platforms are: 1. Coinbase, 2. Kraken, 3. Gemini, 4. Binance, 5. Ouyi, 6. Bitstamp, 7. LMAX Digital, 8. Itbit, 9. Coincheck, 10. Sesame Open Door, these platforms perform excellently in compliance, security, user experience, etc.

The exchange with the lowest handling fee in the currency circle is Binance, with a spot trading rate of 0.1%. 1. Binance: The spot transaction fee rate is 0.1%, and BNB deduction fee is supported. 2. OKX: The spot transaction fee rate is 0.02%-0.15%, suitable for high-frequency trading. 3. Gate.io: The spot transaction fee rate is 0.2%, and the coin is listed quickly.

Sesame Open Door is a platform that focuses on cryptocurrency trading. Users can obtain portals through official websites or social media to ensure that the authenticity of SSL certificates and website content is verified during access.

An investor with a $170 million portfolio considers ShibaInu (SHIB) and MutuumFinance (MUTM) to be key assets in building generational wealth. ShibaInu benefits from growing interest in meme coins, while MutuumFinance is an emerging structured lending project with rapid pre-sales progress. Let's dive into the dynamics of these two crypto assets this week. ShibaInu: Long-term holders dominate ShibaInu's price fell 11% this week, but its long-term growth rate is as high as 123%, and the current trading price is $0.0001139. Technical analysts point out that the cryptocurrency is on the rebound trend line and is

Choose a reliable trading platform such as OKEx to ensure access to the official entrance.
