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
20
votes
2 answers

MesonBuild: How to define dependency to a library that cannot be found by `pkg-config`?

My project (in C) has a third party dependency at build time. But the third party library is, by default, installed to /opt/ instead of /lib, and I cannot find it in pkg-config. From mesonbuild's documentation, should I use declare_dependency, I…
Chong
  • 933
  • 2
  • 10
  • 28
14
votes
2 answers

How to setup meson with Qt creator

I normally use Qt creator with cmake to program C++ projects. Lately I read quite a bit about meson and it's simplicity and I like to test it. This example explains how to setup meson. When using meson, I like however to still use Qt creators…
dani
  • 3,677
  • 4
  • 26
  • 60
13
votes
1 answer

How do I set basic options with meson?

I'm trying to configure a project with meson. Specifically, I'm trying to set some of the options. meson config tells me, among other things: Core options: Option Current Value Possible Values …
einpoklum
  • 118,144
  • 57
  • 340
  • 684
12
votes
4 answers

Can you glob source code with meson?

Is it possible to glob source code files in a meson build?
oz10
  • 153,307
  • 27
  • 93
  • 128
10
votes
3 answers

How can I specify library path when using Meson?

I'm trying to build a c++ project with Meson. The thing is, I have some libraries under /opt/conda but can't figure out how to link the project when running meson build. It seems to be only searching through /usr/lib directory. As far as I…
Jinu
  • 536
  • 1
  • 4
  • 12
10
votes
3 answers

Meson: how to make find_library() works with an unusual path?

For my Meson project I have a dependency that is in an "unusual" place: /opt/MyDependence/lib/libmyLib.so /opt/MyDependence/include/myLib.hpp My meson file is: project('Test', ['cpp']) cpp = meson.get_compiler('cpp') myLib_dep =…
Picaud Vincent
  • 10,518
  • 5
  • 31
  • 70
9
votes
1 answer

'cmake rebuild_cache' for *just* a subdirectory?

I have an issue with the generation of makefiles stage of CMake being slow which is similar to this unanswered question: CMake is slow to generate makefiles My project is made up of a top level CMakeLists.txt file which uses add_subdirectory() to…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
8
votes
2 answers

Does meson has a general function to print out any type variables's value?

I've encountered some projects which uses meson to organize their building system. But when I want to debug their building system, I found it's difficult. The most important task is observing the building system's variable during its running. I…
Clock ZHONG
  • 875
  • 9
  • 23
8
votes
2 answers

How to set up googletest wtih meson?

I have a git repository with some test code in C++ and I want to use Googletest to write some tests. I used git submodule to get it as part of the above repository. I want to use meson as the build engine. So far, so good. However, I cannot fathom…
Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156
8
votes
2 answers

Meson targets that depend on subdir siblings

Here is my project structure: . ├── include ├── src │   ├── abc │   │   ├── include │   │   └── src │   ├── def │   │   ├── include │   │   └── src │   └── ghi │   ├── include │   └── src └── vendor ├── bar │   ├── include │  …
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
7
votes
1 answer

Meson cannot find pykeepass module, I am certain it is installed

I am attempting to build an application using meson, Gnome PasswordSafe. I have successfully built it on Arch, but have since moved to PureOS (Debian). When running: $ meson . _build --prefix=/usr it tells me: meson.build:36:4: ERROR: Problem…
dc3p
  • 79
  • 1
7
votes
1 answer

Handling Meson build options with multiple buildtypes

Having read the Meson site pages (which are generally high quality), I'm still unsure about the intended best practice to handle different options for different buildtypes. So to specify a debug build: meson [srcdir] --buildtype=debug Or to specify…
Jetski S-type
  • 1,138
  • 2
  • 16
  • 32
7
votes
1 answer

How do I speed up Meson build when many targets use the same C++ sources

I have a new meson project with 58 targets. Many of them use the same *.cc files, and meson builds each *.cc file once for each target, which is much slower than autotools. Also, the compile flags should be the same between targets, so in theory…
6
votes
1 answer

Is there a tool for meson similar/equivalent to CPack for CMake?

I have recently started learning meson and I am testing switching to it (from CMake) in one of my projects. The problem is that I usually use cpack to build the project's packages/installers, and after scouring the meson docs for something similar…
Object object
  • 1,939
  • 10
  • 19
6
votes
2 answers

Can the meson project version be assigned dynamically?

I am new to Meson so please forgive me if this is a stupid question. Simple Version of the Question: I want to be able to assign a dynamic version number to the meson project version at build time. Essentially meson.project_version()=my_dynamic_var…
Señor CMasMas
  • 4,290
  • 2
  • 14
  • 21
1
2 3
31 32