This repository accompanies the lesson Creando un Proyecto BΓ‘sico en C++ con Meson, part of the DIBS course (DiseΓ±o e ImplementaciΓ³n de Bibliotecas de Software).
π§ Note: The lesson is written in Spanish, but this repository and its source code are documented in English to make the content more accessible to an international audience.
This is a minimal but well-structured example that shows how to:
- Create a basic C++ project using the Meson build system.
- Set up a clean project structure with root-level and
src/
directory configurations. - Automate the creation of essential project files using shell and PowerShell scripts.
- Build and run the project with Meson, Ninja, and Clang.
- Apply best practices for portable, modular, and maintainable software libraries.
echo-app-cpp-meson/
βββ meson.build
βββ src/
βββ meson.build
βββ main.cpp
Each meson.build
file corresponds to its directory's role in the build process, enabling modular compilation as the project scales.
To compile and run this project, you need:
- Meson
- Ninja
- Clang (LLVM) or another C++ compiler
The lesson includes helper scripts to install these tools automatically for Windows, macOS, and Debian/Ubuntu.
meson setup build
meson compile -C build
./build/src/main
Expected output:
Nothing can happen till you swing the bat
For a full walkthrough, check the companion lesson (in Spanish):
π Creando un Proyecto BΓ‘sico en C++ con Meson
It covers:
- Installing Meson, Ninja, and Clang
- Creating a project structure
- Configuring
meson.build
files - Automating boilerplate setup
- Reflections on software library maintainability
This project follows the Contributor Covenant to foster a welcoming and inclusive environment. Please read CODE_OF_CONDUCT.md
for details.
This project is licensed under the BSD 2-Clause License.
You are free to use, modify, and distribute the code with minimal restrictions. See the license file for full terms.