Commit Graph

2246 Commits

Author SHA1 Message Date
Eisuke Kawashima c46d0e733e doc: fix descriptions of dependency and find_program
They accept list as documented
2024-02-18 16:29:30 -05:00
Jouke Witteveen efad4ba9c5 docs: Remove outdated HDF5 dependency pkg-config statement
A config-tool method has been supported since c02593f and it says so
just a few lines below the outdated statement.
2024-02-14 19:53:37 +02:00
Charles Brunet f4f50db441 qt: add preserve_paths keyword to functions
This allow to generate ui and moc under subdirectories,
as this is allowed with generic generators.
2024-02-12 15:49:55 -08:00
taz-007 152a45a360 doc: benchmark: correct usage on unix 2024-02-12 12:16:32 -08:00
Tristan Partin b08d531c02 Document that alias_target accepts run_tgts since 0.60.0
This was implemented in dc51740e2c,
but was not added to the documentation or marked as a new feature.
2024-02-09 11:56:13 -05:00
Ralf Gommers 80ed1dfa7f Add a numpy dependency with pkg-config and configtool methods
These are being added for NumPy 2.0 The implementation closely follows
the one for the pybind11 dependency.
2024-02-06 12:54:35 -08:00
Sune Vuorela a9f9f03490
docs: Use common conventions for shared libs
Use common conventions for documentation of shared library version and
soversion. In general, the numeric version part is expected to be first
component of version, so suggest this in the example code.
2024-01-25 13:43:54 -05:00
Eli Schwartz b2ddcbad0c
docs: add a technically unneeded "setup" verb to some invocations
`meson <options> -Dxxx=yyy` is technically accurate, but does cause
confusion at least some of the time.
2024-01-24 22:41:18 -05:00
andy5995 2936be7e29 docs: Add NetPanzer to User.md 2024-01-24 07:11:42 -05:00
Eli Schwartz 760d8d50b6
docs: fix another regression in having functional docs
In commit 83a973ca04 a bunch of strange
changes were made, that were not even tested. Make sure people get the
correct command for running coverage targets.
2024-01-20 20:37:05 -05:00
Stas Sergeev 92f638e1f9 compiler.preprocess: add depends kwarg
This patch adds 'depends' keyword to compiler.preprocess().
It allows to execute other targets before doing the preprocessing.
Test-case is added to demonstrate that functionality: it
generates the header before preprocessing the C source that
uses that generated header.

Thanks to @bruchar1 for getting this patch to work.
2024-01-17 13:37:36 -08:00
Simon Ser 0bfe98e7e6 compilers: add c23 and gnu23 c_stds
Closes: https://github.com/mesonbuild/meson/issues/12702
2024-01-15 23:31:52 +02:00
izimuth 1c852f0a98 Add a note for Windows users to GuiTutorial.md
When compiling on Windows using MSVC, you also need to link the SDL2main.lib file. 

I've added a note to the GuiTutorial.md file to mention this.
2024-01-15 20:22:04 +02:00
Sam James a5fdd3771f
compilers: cpp: wire up debugstl for Clang
For Clang, we now pass -D_GLIBCXX_DEBUG=1 if debugstl is enabled, and
we also pass -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG.

Per https://discourse.llvm.org/t/building-a-program-with-d-libcpp-debug-1-against-a-libc-that-is-not-itself-built-with-that-define/59176/3,
we can't use _LIBCPP_DEBUG for older Clang versions as it's unreliable unless
libc++ was built with it.

We choose MODE_DEBUG for stldebug while building with assertions will do
MODE_EXTENSIVE.

Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-01-09 20:49:27 -05:00
Sam James 90098473d5
compilers: cpp: wire up stdlib assertions
None of the options set here affect ABI and are intended for detecting constraint
violations.

For GCC, we simply need to set -D_GLIBCXX_ASSERTIONS.

For Clang, the situation is far more complicated:
* LLVM 18 uses a 'hardened mode' (https://libcxx.llvm.org/Hardening.html).
  There are several levels of severity available here. I've chosen
  _LIBCPP_HARDENING_MODE_EXTENSIVE as the strongest-but-one. The strongest
  one (_DEBUG) doesn't affect ABI still but is reserved for stldebug.

* LLVM 15 uses a similar approach to libstdc++ called '_LIBCPP_ENABLE_ASSERTIONS'

Note that LLVM 17 while in development had fully deprecated _LIBCPP_ENABLE_ASSERTIONS
in favour of hardened, but changed its mind last-minute: https://discourse.llvm.org/t/rfc-hardening-in-libc/73925/4.

Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-01-09 02:02:03 -05:00
Erik Bråthen Solem 0e1cba6d8b envconfig: read CYTHON from the environment and use it if set
Add support for specifying Cython compiler using the CYTHON environment
variable. If not set, proceed with the names hard coded for Cython.
2024-01-01 01:50:37 -05:00
Chris Mayo 65e4fb391f docs: Document Qt tools updates in 0.63
Especially relevant for users of Ubuntu 22.04 which has packages for
Qt 6.2 and Meson 0.61.

a606ce22e ("Add support for Qt 6.1+", 2022-01-08)
d68a0651e ("qt module: also prefer the changed name scheme for the tools", 2022-02-09)
2024-01-01 01:48:54 -05:00
Chris Mayo 92bcf88f0c docs: Fix since for compile_translations in _include_qt_base 2024-01-01 01:48:54 -05:00
Chris Mayo dc3e027380 docs: Rename Qt4 & Qt5 in Dependencies to Qt 2024-01-01 01:48:54 -05:00
Chris Mayo abeea41880 docs: Use Qt instead of qt 2024-01-01 01:48:54 -05:00
Eli Schwartz 4a96ad0170
docs: fix regression that broke intended meaning of compiler variables note
In commit 58c2aeb5e4, an asterisk used to
indicate "see note at bottom" was doubled up into an "italicize this
paragraph", which didn't contextually make any sense.

See: https://github.com/mesonbuild/meson/pull/12674#issue-2057666653
2023-12-28 17:28:42 -05:00
Marina.Kalashina 4351f56f13 Add CLion to the list of IDE integrations
CLion was not mentioned in the list of IDE integrations. This commit adds it, also
adds a “3rd party" prefix to the Meson Syntax Highlighter plugin to indicate that it doesn't come from JetBrains, and sorts the list alphabetically.
2023-12-27 16:25:15 +02:00
Michael Gene Brockus (Dreamer) 059b9e048d
Update Users.md (#12634)
* Update Users.md
2023-12-18 00:13:23 +02:00
Dylan Baker e991c4d454 Use SPDX-License-Identifier consistently
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.

This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.

SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
2023-12-13 15:19:21 -05:00
Vincent Torri 1f82afe899 add the EFL, Enlightenment, libdwarf and ThorVG as users of meson 2023-12-13 08:29:55 -08:00
Nicolas Werner ebf5757c59 cmake: parse project version
This properly sets the project version in projects meson generates from
cmake projects. This allows dependency fallbacks to properly check the
version constraints in dependency calls when falling back to a cmake
subproject. Before this would fail, because the project version was
undefined.
2023-12-12 20:14:26 -05:00
Eli Schwartz caa38dad45 fix broken type annotation imports being ignored
If an annotation could not be resolved, it's classified as a "missing
import" and our configuration ignored it:

```
Skipping analyzing "mesonbuild.backends": module is installed, but missing library stubs or py.typed marker
```

As far as mypy is concerned, this library may or may not exist, but it
doesn't have any typing information at all (may need to be installed
first).

We ignored this because of our docs/ and tools/ thirdparty dependencies,
but we really should not. It is trivial to install them, and then
enforce that this "just works".

By enforcing it, we also make sure typos get caught.
2023-11-26 17:12:52 -05:00
Xavier Claessens 85e4ee5b54 File: Add full_path() method
This is needed now that str.format() is not allowing it any more. It is
also more consistent with other objects that have that method as well,
such as build targets.

Fixes: #12406
2023-11-24 22:15:14 +02:00
Bin Meng 7f5f432ec9 docs: Update Quick-guide.md
Change the shell prompt to '#' to when installing as root.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2023-11-22 22:30:58 +02:00
Gerion Entrup 3605981466 docs/dependency: fix type of version kwarg 2023-11-22 22:29:49 +02:00
Filipe Laíns 63453564ee docs: document out of bounds behavior in str.substring
Signed-off-by: Filipe Laíns <lains@riseup.net>
2023-11-22 22:15:13 +02:00
Peter Harris 96f0b3ca38 Update release frequency to match reality
Releases have been happening an average of once every 90 days for the
past two years (since 0.60.0). If we just look at releases since 1.0.0,
the average is over 100 days.
2023-11-22 22:14:21 +02:00
Alyssa Ross 9aa1393fdb docs: fix bindgen_clang_arguments example
> error: unsupported option '--target'; did you mean '-target'?
2023-11-22 22:13:39 +02:00
Jussi Pakkanen 7368795d13 Generate release notes for 1.3.0. 2023-11-19 21:58:19 +02:00
albert 2b49408395 note on glib library 2023-11-17 12:29:11 -05:00
Eli Schwartz 398c4b2287
dependencies: allow get_variable to define multiple pkgconfig defines
It was previously impossible to do this:

```
dep.get_pkgconfig_variable(
    'foo',
    define_variable: ['prefix', '/usr', 'datadir', '/usr/share'],
)
```

since get_pkgconfig_variable mandated exactly two (if any) arguments.

However, you could do this:
```
dep.get_variable(
    'foo',
    pkgconfig_define: ['prefix', '/usr', 'datadir', '/usr/share'],
)
```

It would silently do the wrong thing, by defining "prefix" as
`/usr=datadir=/usr/share`, which might not "matter" if only datadir was
used in the "foo" variable as the unmodified value might be adequate.

The actual intention of anyone writing such a meson.build is that they
aren't sure whether the .pc file uses ${prefix} or ${datadir} (or which
one gets used, might have changed between versions of that .pc file,
even).

A recent refactor made this into a hard error, which broke some projects
that were doing this and inadvertently depending on some .pc file that
only used the second variable. (This was "fine" since the result was
essentially meaningful, and even resulted in behavior identical to the
intended behavior if both projects were installed into the same prefix
-- in which case there's nothing to remap.)

Re-allow this. There are two ways we could re-allow this:
- ignore it with a warning
- add a new feature to allow actually doing this

Since the use case which triggered this bug actually has a pretty good
reason to want to do this, it makes sense to add the new feature.

Fixes https://bugs.gentoo.org/916576
Fixes https://github.com/containers/bubblewrap/issues/609
2023-11-14 14:59:12 -05:00
Michael Gene Brockus (Dreamer) 9aa14eb013 Update Users.md 2023-11-05 20:00:51 +02:00
Michael Gene Brockus (Dreamer) bf7d617b8c Adding Trilobite Data to Users.md 2023-11-05 20:00:18 +02:00
Andrew McNulty 74712f2dbc scan-build: Exclude subprojects from scan-build report
When a user invokes the scan-build target that Meson generates
all subprojects are included in the resulting report. This commit
modifies the invocation of scan-build to exclude all bugs that
scan-build finds in the subprojects from the final report.

A release note has also been added describing the changed behaviour.
2023-11-02 18:41:51 -04:00
Tristan Partin 46cedeb431 Support -j as a shorthand for --num-processes
We already use -j to support parallelism in meson compile. So let's add
the same for meson test and meson subprojects.
2023-10-20 12:49:38 -04:00
Xavier Claessens bf9314e00d pkgconfig: Allow setting both pkgconfig and pkg-config
This was previously allowed for different usage. Keep allowing it, but
with non fatal deprecation notice, and ignore the value from legacy
pkgconfig.
2023-10-19 15:20:22 -04:00
Sam James 7b7d2e060b mtest: set ASAN_OPTIONS and UBSAN_OPTIONS to abort by default
Do as we do for MALLOC_PERTURB and set a sensible value for both ASAN_OPTIONS
and UBSAN_OPTIONS to abort on failure and give more helpful output at the
same time. We do not set these options if the user has exported a value
themselves to allow override.

In the last week alone, I've observed two cases where people were expecting
sanitizers to abort on failure and were surprised when it didn't:
1) 252d693797
2) c47df433f7

Correct this - which is in-line with meson's DWIM/DTRT philosophy.

Signed-off-by: Sam James <sam@gentoo.org>
2023-10-19 14:47:19 -04:00
Paolo Bonzini 0781eab481 release notes: fix snippet for "fill:" argument
The release notes were using the older spelling "length".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-10-17 11:28:59 -04:00
Xavier Claessens dc329f0f04 interpreter: Add support for cargo subproject 2023-10-09 21:13:58 -04:00
Dylan Baker 013536fcb4 interpreter: add <lang>_(static|shared)_args
Which allow passing arguments specifically to the static or shared
libraries.

For design, this is all handled in the interpreter, by the build layer
the arguments are combined into the existing fields. This limits changes
required in the mid and backend layers
2023-10-09 17:33:48 -04:00
Dylan Baker cbca191948 interpreter: Handle BuildTarget.vala_args as Files in the interpreter
Way back in Meson 0.25, support was added to `vala_args` for Files.
Strangely, this was never added to any other language, though it's been
discussed before. For type safety, it makes more sense to handle this in
the interpreter level, and pass only strings into the build IR.

This is accomplished by adding a `depend_files` field to the
`BuildTarget` class (which is not exposed to the user), and adding the
depend files into that field, while converting the arguments to relative
string paths. This ensures both the proper build dependencies happen, as
well as that the arguments are always strings.
2023-10-09 17:33:48 -04:00
Nomura 3cac6ea545 Add env kwarg in generator.process() 2023-10-05 09:59:43 -07:00
Dudemanguy 03a0d3ddfb mcompile: add suffix as an additional parameter
Since the previous commit allows for more scenarios with name
collisions, it makes sense to expand the compile command so that it can
also take into account suffixes. i.e. meson compile -C build foo.exe can
now work if the executable has an exe suffix along with being named foo.
2023-10-05 08:43:38 -07:00
Dudemanguy adb1a360b9 build: use suffix when getting target id for exes
When checking target names, meson explictly forbids having multiple
targets with the same name. This is good, but it is strict and it is
impossible to have targets with the same basename and differing suffixes
(e.g. foo and foo.bin) in the same directory. Allow this for executables
by including the suffix (if it exists) in the interal target id. So foo
would be foo@exe and foo.bin would be foo.bin@exe.
2023-10-05 08:43:38 -07:00
Michael Gene Brockus (Dreamer) 184927eaf5 Update Users.md 2023-09-30 16:04:59 +03:00