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
6
votes
3 answers

Can Meson read the contents of a file

Is it possible for Meson to read the contents of a file into an array or a string? From here a string can be split into an array, and an array can be looped over with foreach, but I haven't been able to find a way to get the data from the file to…
Pentarctagon
  • 413
  • 2
  • 5
  • 12
6
votes
2 answers

Set PKG_CONFIG_PATH inside meson.build

I am using meson in a couple of C projects (projectA and projectB), where projectB links to a library from projectA. In projectA/meson.build, I have written a pkg-config projectA.pc file using meson, that is installed to…
zeehio
  • 4,023
  • 2
  • 34
  • 48
6
votes
1 answer

Is `meson.source_root()` the project root directory?

Is the directory return by meson.source_root() the project root directory (with the root level meson.build file) or is it the path of the current meson.build file being processed?
oz10
  • 153,307
  • 27
  • 93
  • 128
5
votes
1 answer

Unable to install Scipy with MKL using Meson

I am attempting to install scipy 1.9.1 with the MKL implementation of BLAS, using pip as my package manager. For numpy, I can do this with: pip install numpy --no-binary numpy. Doing this with Scipy (pip install scipy--no-binary scipy) fails with…
Evan Gaertner
  • 51
  • 1
  • 3
5
votes
0 answers

How to print all dependencies in meson?

I checked out a gtk project inside a docker and during meson build found many dependencies are missing eg. libwayland-dev, libxrandr-dev... Because meson fails at the first missing dependency, I had to redo this over and over to get install the…
ryanafrish7
  • 3,222
  • 5
  • 20
  • 35
5
votes
1 answer

how to set debug and optimization flag with meson

I use meson 0.53.2 on ubuntu 20.04. I would like to have a maximally optimized executable (-Ofast) but contain all debug symbols (-g3) If I use --buildtype=release it optimizes -O2 and the executable contains no debug symbol. If I use…
mastupristi
  • 1,240
  • 1
  • 13
  • 29
5
votes
2 answers

How to copy a file in Meson to a subdirectory

My application uses a Glade file and also cached data in a JSON file. When I do the following, everything works okay as long as the user installs the application with ninja install #Install cached JSON file install_data( …
g_l
  • 621
  • 5
  • 15
5
votes
1 answer

How to get the include directories from a dependency in meson build system

In meson build system, I want to get the include directories from a dependency: Simple example meson.build, using wxWidgets dependecy as example: project('project1', ['cpp']) wxdep = dependency('wxWidgets') wxincludes = # ... how to get the…
foolo
  • 804
  • 12
  • 22
5
votes
1 answer

Meson picks the wrong compiler (GCC instead on clang)

I am trying to configure my project to build with LLVM/clang++, however GCC is always picked: $ /opt/llvm/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04/bin/clang++ --version clang version 7.0.1 (tags/RELEASE_701/final) Target:…
Pietro
  • 12,086
  • 26
  • 100
  • 193
5
votes
1 answer

Cannot use the C++ `std::filesystem` library with Meson build

I am trying to build a piece of C++ code that uses the new C++17 Filesystem library, using the Meson build system. This is the piece of meson.build file involved: if not compiler.has_header('filesystem') # This is OK warning('The compiler has…
Pietro
  • 12,086
  • 26
  • 100
  • 193
5
votes
1 answer

How to give releative path for dirs option in meson build to find the thrid party library?

I am trying to build custom gst-plugin which has third party library dependency. With cc.find_library and dirs option (takes absolute path) I am able to build the setup. But I want to include the relative paths, so that when others uses my package…
saleem
  • 53
  • 5
5
votes
2 answers

How can i define DEBUG when the build type is debug?

I want to pass "-DDEBUG" to the C++ compiler when the build type starts with "debug", something like this: if meson.build_type().starts_with('debug') add_global_arguments('-DDEBUG', language : 'cpp') endif However there is no meson.build_type(),…
Jens Mühlenhoff
  • 14,565
  • 6
  • 56
  • 113
5
votes
1 answer

In meson build, can you set the working directory for unit tests?

In a meson build, is it possible to set the working directory before executing unit tests? It uses ninja by default to run the tests, so perhaps there's an option you can pass to ninja to set the directory? Why I'm asking is sometimes unit tests…
oz10
  • 153,307
  • 27
  • 93
  • 128
4
votes
0 answers

How to add vala language into some existing c/c++ project?

Vala has c# like syntax and compiles to c code for performance, I would like to try it with some of my existing projects. But my existing projects are all c/c++ (mainly c++ with cmake build system) project, how to add vala gradually, for example,…
user10838321
4
votes
0 answers

How to cross-compile with Meson and a Python dependency?

I'm trying to cross-compile an application using Meson. The application has a Python dependency. I'm building on a Linux system (the build machine) and I'm building a Windows executable (the host machine). I cannot make Meson detect the Python…
EvR
  • 105
  • 1
  • 5
1
2
3
31 32