Questions tagged [meson-build]

Meson is a build configuration system used to build C/C++, Java, Rust, Objective-C/C++, and Fortran projects. It uses a DSL to describe project targets. This tag is for questions about the meson build system and DSL syntax or usage.

Meson is a build configuration system used to build C/C++, Java, Rust, Objective-C/C++, and Fortran.

It is conceptually similar to MPC or CMake, and draws strengths from them as well as SCons, Autoconf.

Project targets are described using a non-Turing complete DSL. Despite being implemented in Python, no direct calls into Python are permitted, nor is any Python syntax directly supported. Strictly speaking, the Meson processor could be reimplemented in any language and would be able to handle the DSL without assistance from an embedded Python interpreter.

For more information about Meson, see their home page. To contribute, see their source code repository on github.com.

469 questions
3
votes
1 answer

Meson / Ninja build system - How to run custom script at Uninstall?

Meson/Ninja provide an easy method to run a script at install time. For example, this line will tell Meson to run the glib-compile-schemas command to compile the GSettings on Linux (system configuration…
Igor Carmagna
  • 957
  • 1
  • 10
  • 34
3
votes
1 answer

How to build zstd as a subproject with meson build system

I want to use zstd compression library for my C++ library project. My build system is based on meson. My meson.build file looks like this project('foo', 'cpp', default_options :     ['cpp_std=c++17', 'buildtype=release'],     version : '0.1',…
oleksii
  • 35,458
  • 16
  • 93
  • 163
3
votes
1 answer

Meson and NInja build system: specifify where binaries are stored

I have a project that needs to be built like this: ./meson.py build ./ninja -C build install This works well. The only thing is: the binaries are stored in (on Linux): /usr/local/bin. This would require me to input root password because the…
mle0312
  • 365
  • 5
  • 17
3
votes
2 answers

how to set meson link dependency for buildin lib as "-lm -lrt"

on meson build, dependencies are resolved by pkg-config/cmake ... but for system libs, no docs. I only find 2 of them: zlib stands for -lz threads stands for -lpthread then how can I link -lm -lrt ? "m" "math" "libm" runtime all guess fail.
fanlix
  • 1,248
  • 1
  • 13
  • 22
3
votes
1 answer

How to perform code coverage in C++ using meson?

I'm using meson and ninja as build system in my C++ project and I've configured catch2 as testing framework. I was wondering how to perform code coverage with the tests that I've written. I read this page, https://mesonbuild.com/Unit-tests.html…
Antonio La Marra
  • 5,949
  • 4
  • 15
  • 23
3
votes
1 answer

Meson absolute path from include_directories

In Meson, is it possible to get a string absolute path from an object created by a call to include_directories? My use case: include_dirs = include_directories('include') lib = library( 'mylib', source_files, …
Aart Stuurman
  • 3,188
  • 4
  • 26
  • 44
3
votes
1 answer

How do you suppress the console window on Windows?

Take the basic example Gtk+ app and calll it main.vala: using Gtk; int main (string[] args) { Gtk.init (ref args); var window = new Window (); window.title = "First GTK+ Program"; window.border_width = 10; …
Jens Mühlenhoff
  • 14,565
  • 6
  • 56
  • 113
3
votes
2 answers

How to launch an external Python program from Meson?

Before building my project, I have to generate a C++ source file through a Python script, using the Meson build system. Is this the correct way, i.e. consider Python as a generic external command? # meson.build r = run_command('python', 'arg1',…
Pietro
  • 12,086
  • 26
  • 100
  • 193
3
votes
2 answers

How to run a shell command from a Meson script?

How can I run a shell command (e.g. cp, i.e. copy) from a Meson build script? I tried with this code: r = run_command('cp', 'test.txt', 'test2.txt') if r.returncode() != 0 warning('Command failed') endif But it does nothing. run_command runs…
Pietro
  • 12,086
  • 26
  • 100
  • 193
3
votes
1 answer

Flatpak bundle libmysqlclient

I'm trying to build a Vala program with flatpak. I need to connect to a mysql-server and thats why i need to bundle libmysqlclient with my flatpak. Thats why I added mysql_config to my meson.build file. project('zeiterfassunggtk', ['c', 'vala'], …
Gerald Zehetner
  • 596
  • 4
  • 21
3
votes
0 answers

Meson find_program not finding program

I'm building a Vala program with gnome-builder and flatpak. I wan't to connect to a mySQL Database. Thats why I need to run mysql_config to get the right compiler flags. So I added mysql_config = find_program('mysql_config')to my meson.build…
Gerald Zehetner
  • 596
  • 4
  • 21
3
votes
1 answer

File path issue with Meson and Eigen

I cannot make local include paths work in the Meson build system. This C++ inclusion works correctly: #include This one does not: #include "Third-Party/eigen/Eigen/Dense" fatal error:…
Pietro
  • 12,086
  • 26
  • 100
  • 193
3
votes
2 answers

How to include library and header files from another one of my Meson projects?

I have two projects on the go, one is a library, and the other wants to use some of that library. My directory structure is: Work/ ProjectA/ src/ include/ build/ ProjectB/ …
windenergy
  • 361
  • 1
  • 4
  • 13
3
votes
4 answers

How to run meson build system on windows?

I would like to use meson build system on windows. I am python noob. It looks like I installed it, but I do not know how to run it. I have installed python 3.6. I have installed meson from 'cmd': C:\>python -m pip install meson Collecting meson …
urkon
  • 233
  • 1
  • 5
  • 15
3
votes
2 answers

In meson can you test for presence of a directory in your project?

Using meson build, is it possible to test for the existence of a directory in my project? For example, I typically put acceptance tests next to my unit tests in a folder structure like this: library/ header.hp src/ …
oz10
  • 153,307
  • 27
  • 93
  • 128