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

How can I run a custom command at build time in meson?

in my projects I adopt a semantic versioning scheme following the standard described by semver. I obtain something like this: product_v1.2.3-alpha-dirty.elf . I work with embedded system and with make I usually generate a version_autogen.h file at…
LeonFibuck
  • 336
  • 2
  • 12
4
votes
2 answers

is there any way to use conan package in meson?

We can use meson build system in conan. But I cannot find any document about how to add conan package as dependency in meson.build. It is very simple in cmake, we can simply use conan_cmake_run. How can I do the similar thing in meson?
Wang
  • 7,250
  • 4
  • 35
  • 66
4
votes
2 answers

How can I tell meson in which directories to look for dependencies?

I am coming from CMake to meson. I like to work in isolated environments using conda. This way I can control which packages are installed for each project. Now, In cmake I would pass -DCMAKE_FIND_ROOT_PATH=$CONDA_PREFIX in order to root the search…
Avi Shukron
  • 6,088
  • 8
  • 50
  • 84
4
votes
1 answer

How to compile Node.js native api extension via meson build system

I want compile Node.js C/C++ extension without using node-gyp package. I have experience with meson and would use it to compile Node.js module. Can u suggest example with how to compile Node.js native module? P.S. I use a few subproject with static…
Vitold S.
  • 402
  • 4
  • 13
4
votes
1 answer

How to build/cross-compile an existing meson or cmake project under Android AOSP?

I am trying to understand how to build executable and libraries using Android.mk and Android.bp under AOSP. And I am able to compile simple c programs. I was wondering if there is a way to cross-compile existing CMake and meson projects under…
masterajay
  • 63
  • 3
4
votes
3 answers

Prefix all sources with src/ in Meson

Relative to my project root where meson.build is located, all of my source files are under src/. Is it possible to specify these source files in meson.build in a way that wouldn't force me to prefix them all with src/, given that that's somewhat…
sssilver
  • 2,549
  • 3
  • 24
  • 34
4
votes
1 answer

Cannot run Doxygen from Meson on a C++ project

I cannot run Doxygen through Meson's configuration. This is the related code in meson.build: doxygen = find_program('doxygen') ... run_target('docs', command : 'doxygen ' + meson.source_root() + '/Doxyfile') The doxygen executable is successfully…
Pietro
  • 12,086
  • 26
  • 100
  • 193
4
votes
2 answers

Flatpak Meson Not Finding Vala Libraries From Gnome Builder

From Linux, I'm using Meson (0.44.0) within Gnome Builder (3.26.4) for a console program that will use Gee and GXml. My intent is to write this in Genie. When I use Meson within Gnome Builder it fails but the same succeeds when invoked from the…
AsymLabs
  • 933
  • 9
  • 15
4
votes
2 answers

Link static library to shared library or to a binary

I have a static library from the project A (let's call it liba.so) and I want to compile a shared library in my project B (let's call it libb.so) and embed liba.so in it. Also, I have a binary in that project B which also depends on liba.so, so I…
alexandernst
  • 14,352
  • 22
  • 97
  • 197
4
votes
1 answer

When defining external dependencies in meson, can you add search paths?

When defining a target in meson, you can declare dependencies on external projects using the following syntax: zdep = dependency('zlib', version : '>=1.2.8') exe = executable('zlibprog', 'prog.c', dependencies : zdep) This checks the standard…
oz10
  • 153,307
  • 27
  • 93
  • 128
3
votes
1 answer

Meson and clang++ on Ubuntu 22.04.2 LTS; ld: cannot find -lstdc++

I've always been able to compile meson projects using clang and clang++ by running: CC=clang CXX=clang++ meson setup clang-debug --buildtype=debug The output I get is: he Meson build system Version: 1.1.0 Source dir:…
hetepeperfan
  • 4,292
  • 1
  • 29
  • 47
3
votes
1 answer

meson cant find a cross-compile library

I'm building my project using meson. When building native - all is OK. meson is able to find all dependencies, and create the executable. When using a aarch cross file - the dependency just doesn't work... This is my meson.build: # builds the…
CIsForCookies
  • 12,097
  • 11
  • 59
  • 124
3
votes
1 answer

ERROR: Could not detect Ninja v1.8.2 or newer - Meson

When I try to run Meson, It complains that it can't find Ninja v1.8.2 or newer. I ran this: meson build-debug This resulted in the error explained above. I have the latest tools: Ninja v1.10.2 Meson 0.61.2 x64 Native Tools Command Prompt for VS…
GitSD
  • 46
  • 2
  • 10
3
votes
1 answer

How to link with a library built using Meson custom_target()?

I'm using Meson custom_target() to build a 3rd party foobar library: foobar_ct = custom_target('foobar_build', command: `script.sh`, output: 'foobar.a') The custom target calls my script, which in turn calls…
Danijel
  • 8,198
  • 18
  • 69
  • 133
3
votes
1 answer

How to add a linker command line option into meson

How do we add a linker command line option into meson build system e.g: If a wanted CL: -Wl,-rpath=/usr/local/lib so it must be found correctly every time the release program is executed, how to set the meson configuration ? .
user15938505
1 2
3
31 32