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
2
votes
1 answer

Need help translating a Make File into Meson Build File for Vala

I am working on an Application in Vala. I need to use both webkit2gtk-web-extension-4.0 and webkit2gtk-4.0 in an single project. I am following the example from - https://github.com/rschroll/webkitdom/tree/extension The Make File from the example…
Manikk
  • 103
  • 7
2
votes
0 answers

Meson conditional address sanitization

I basically want to do something like this if get_option('buildtype') == 'debug' add_project_arguments('-fsanitize=address', language : 'c') add_project_link_arguments('-fsanitize=address', language : 'c') endif except using the…
Scoopta
  • 987
  • 1
  • 9
  • 22
2
votes
1 answer

Unable to build static lib of mesa (libGL.a)

Trying to build a static library of libGL. Looking at "meson configure", it states that static libraries are default. Still, I only end up with a libGL.so file. Is the any magic voodoo to get the static version to compile? Only answers I find online…
Daniele Testa
  • 1,538
  • 3
  • 16
  • 34
2
votes
2 answers

Modify install prefix from meson script

I need to modify install prefix option in meson build script... My idea is, when the user select some special option, the install prefix is getting from external tool (specifically, using ${CORSS}gcc -print-sysroot)
2
votes
0 answers

How to specify rpath for debug builds in meson?

I am trying to port qmake project to meson build system. Project is a simple Qt GUI application, with no other dependencies. Application is cross-platform one, it must compile and run on macOS/Linux/Windows. Right now i'm stuck on mac. Debug…
eraxillan
  • 1,552
  • 1
  • 19
  • 40
2
votes
1 answer

Link Against Existing `.lib` File in Meson Build on Windows

I'm building a simple project in Meson Build. While it is well documented how to create a dependency in Meson Build Documentation (With implicit assumption of UNIX / LINUX system) it is not clear how to link against arbitrary not on path…
Royi
  • 4,640
  • 6
  • 46
  • 64
2
votes
1 answer

How do I derive an executable name from a source file in Meson build?

I'm trying to create a list of unit test targets in Meson, with each test case built from a single source file. The source files are defined with a files() command in a subdirectory: my_test_files =…
rellenberg
  • 105
  • 8
2
votes
1 answer

libpeas-1.0 not found by meson-dependency but by pkg-config

I am using GNOME builder to create a vala project and tried to add libpeas-1.0 as a dependency to meson via: dependency('libpeas-1.0', version: '>= 1.22') which fails with: src/meson.build:10:0: ERROR: Native dependency 'libpeas-1.0' not found if…
0815
  • 25
  • 5
2
votes
0 answers

-Wno-pedantic ignored on older gcc

I have a C++ application where I am using zero-arguments-variadic macros. However, I don't really like the standard conforming solution posted here on SO in various answers, but rather keep the GCC specific ##__VAR_ARGS__. I'd like to catch as much…
flowit
  • 1,382
  • 1
  • 10
  • 36
2
votes
1 answer

Meson cross compiling dependencies

Hello I am trying to cross compile systemd for arm, but I got stuck on 'mount' cross depencency. I managed to cross compile libmount from util-linux but can not figure out where to put it or how to specify where should meson look for it. There is…
Dalbenn
  • 117
  • 2
  • 12
2
votes
2 answers

meson cross-file for different platforms

In meson you specify a cross-compiler in a cross-file like: [binaries] c = '/opt/yada-yada/gcc/bin/powerpc-yada-yada-gcc' This is great if you know exactly where your compiler is going to live. If I want to specify the same compiler for Windows, I…
Wasim
  • 23
  • 5
2
votes
0 answers

How to compile AIDL files using meson?

Here are 2 aidl files. src/com/rom1v/example/Service.aidl: package com.rom1v.example; interface Service { void doSomething(); } src/another/package/Other.aidl: package another.package; interface Other { int get(); } I would like to compile…
rom1v
  • 2,752
  • 3
  • 21
  • 47
2
votes
1 answer

Meson working with data/assets and portable/relative paths

I'd like to use Meson to build a little game in C++. Let's say that theses are my file: . ├── img │   └── img.png ├── meson.buid └── src ├── main.cpp └── meson.build Here are the meson.buid files: # meson.build project('mygame',…
Antonin Décimo
  • 499
  • 3
  • 17
2
votes
2 answers

How to use OpenMP in a C project built with meson

I am quite new to meson and C, please forgive me if the answer to this question is trivial ... I want to use OpenMP in a C project, and I am using meson as a build tool. I want to compile the parallel for example from this tutorial. My main.c looks…
Kantenkopp
  • 65
  • 7
2
votes
1 answer

Add compiler flag only if --default-library=shared is used

The meson build system allows to either build shared or static libraries with the option --default-library. However I am not able to know if a shared or static library is being built and I need that to pass at least a define. Is there a way to query…
zeehio
  • 4,023
  • 2
  • 34
  • 48