Commit Graph

1932 Commits

Author SHA1 Message Date
CLanguagePurist 87b4b0d4e7
Update Unit-tests.md (#10515) 2022-06-21 21:49:12 +03:00
Eli Schwartz 22dcb692ad python module: implicitly add python dep to extensions
If there isn't a preexisting dependency on python, append one. It's
almost assuredly needed, so just do the right thing out of the box.
2022-06-19 21:44:17 +03:00
Xavier Claessens 807cbcb350 external-project: Add depends kwarg
The unit test was racy but surprisingly never failed on CI. The reason
is we need to ensure ninja build somelib.so before running `make` into
the external project.
2022-06-17 18:56:13 -04:00
Eli Schwartz b13a95c301
docs: d_module_versions has an undocumented ability to accept integers
Dlang uses both integer version "levels" and arbitrary string
identifiers, and we support both, but don't mention it in the docs.

Also update a test case to pass one via declare_dependency. We already
test this kwarg for build_target.
2022-06-17 14:33:02 -04:00
Eli Schwartz e99e55d0aa
docs: fix incorrect info for declare_dependency sources
The type information is clearly wrong as it disagrees with the
description w.r.t. generated headers.

We also rely on it accepting custom targets for the obvious reason that
we accept it in a build target too! In fact, we rely on this in the
testsuite too.
2022-06-17 14:33:01 -04:00
Eli Schwartz 41860f686f docs: ensure stable order of release notes
Merging snippets happens in arbitrary order -- whatever filesystem
globbing results in. This didn't matter too much when we ran it once at
release time and checked the resulting release notes into git. However,
now that we generate a temporary version of the release notes for
development versions, the order of the results will periodically change.

Sort the files before processing them in order to guarantee that
whatever order they are in, they stay that way.

As a side effect, it's now technically possible to guarantee an ordering
by judicious use of snippets naming.
2022-06-17 06:48:45 -04:00
Xavier Claessens ebfbaef7ee doc: Add meson.override_dependency() in external-project example 2022-06-16 09:18:24 -04:00
ff 4ad869cd84 fix typo in IndepthTutorial.md 2022-06-10 12:41:00 -07:00
Paweł Marczewski 9061c3a52d wrap: Add support for applying a list of patch files
Co-authored-by: Xavier Claessens <xavier.claessens@collabora.com>
2022-06-07 06:43:39 -04:00
Marco Trevisan (Treviño) 29c26d5b26 compilers: Add support for stand-alone leak sanitizer
Leak sanitizer can be enabled without the whole AddressSanitizer, this
can be done by passing -fsanitize=leak as documented at [1].

Meson doesn't support this, so add support for it.

[1] https://clang.llvm.org/docs/LeakSanitizer.html
2022-06-06 09:40:14 -07:00
Xavier Claessens 39ba552811 Add "in development" in release notes title
It was already written in the side menu, but better have it in the page
title too.
2022-06-01 21:52:45 -04:00
Eli Schwartz eec7b2c359
docs: fix incorrect link
When referring to the custom_target docs, we want to point to the docs
on the function, not the docs on the returned method.
2022-05-31 17:49:30 -04:00
Eli Schwartz c88a1dc55c
fix bug in i18n merge_file/itstool_join revealed by previous commit
Logically, i18n.merge_file cannot ever take a MULTI_OUTPUT_KW, but it
does take a CT_OUTPUT_KW-like interface.

Actually trying to pass multiple merge_file outputs causes the
msgfmthelper script to be entirely malformed in the arguments it
accepts, and treat the broken one like a --flag, then exit with argparse
errors.

Even if we somehow assumed that somehow it was designed to actually
allow this, msgfmt doesn't support conceptually passing multiple outputs
so that would be a msgfmt error instead of an error inside the guts of
`meson --internal msgfmthelper`.

Same logic applies again for the itstool command and the itstool
internal helper.

Catch this error at configuration time by using the single-output kwarg
form.

Likewise, it's totally nonsense to accept multiple install_dir or
install_tags, and ever since commit 11f9638035
the CustomTarget itself won't even check this.
2022-05-31 17:49:29 -04:00
Karl Linden 40c69630df Fix typo in documentation for add_*_arguments 2022-05-31 17:48:45 -04:00
Florian "sp1rit"​ ad8f24f232 Implement `preserve_path` for install_headers
The `install_headers` function now has an optional argument
`preserve_path` that allows installing multi-directory
headerfile structures that live alongside sourcecode with a
single command.

For example, the headerfile structure

headers = [
  'one.h',
  'two.h',
  'alpha/one.h',
  'alpha/two.h',
  'alpha/three.h'
  'beta/one.h'
]

can now be passed to `install_headers(headers, subdir: 'mylib', preserve_path: true)`
and the resulting directory tree will look like

{prefix}
└── include
    └── mylib
        ├── alpha
        │   ├── one.h
        │   ├── two.h
        │   └── three.h
        ├── beta
        │   └── one.h
        ├── one.h
        └── two.h

Fixes #3371
2022-05-30 18:03:01 -04:00
Guilherme Janczak 704cd1a79d remove repetition and stiff language 2022-05-26 20:48:47 -04:00
Guilherme Janczak 3c66be0c1d don't tell documentation contributors to skip CI
The CI correctly handles documentation changes automatically, it's no
longer necessary to do it by hand.
2022-05-26 20:47:39 -04:00
Xavier Claessens c88c1e7dba doc: Generate dev release notes 2022-05-24 20:19:46 +03:00
andy5995 5746469e45 Compiler-properties.md:link to compiler object page 2022-05-24 20:18:42 +03:00
Tristan Partin 8d918e0147 Add cc.has_function_attribute('sentinel') 2022-05-19 15:05:53 -04:00
Tristan Partin 5d438b6aed Add cc.has_function_attribute('section') 2022-05-19 15:05:53 -04:00
Adel Kara Slimane 459970b55f Update Creating-OSX-packages.md
Qt offers a tool to automatize most of what needs to be done regarding its libraries.
2022-05-16 20:45:30 +03:00
Eli Schwartz aa874ea0d0 python module: default extensions to hidden symbol visibility
python compiled extensions should never need to expose any symbol other
than PyInit_* which is declared with default visibility via
PyMODINIT_FUNC on supported compilers.

Thus, a reasonably sane default is to mark any other symbols as hidden,
while still respecting any manually specified visibility.

Gate this on the version of python itself, as not all versions decorate
PyMODINIT_FUNC properly.
2022-05-09 10:49:04 -04:00
Eli Schwartz 04c728a126 compilers/c++: Add MSVC option to make the __cplusplus define accurate
Otherwise it always returns the value for c++98, starting with MSVC 2017
15.7 or later. Earlier versions are not affected by this mis-feature.

See: https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160

This was originally applied as 0b97d58548
but later reverted because it made the CI red. Try it again, now.

Original-patch-by: Dylan Baker <dylan@pnwbakers.com>
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-05-08 14:40:54 -04:00
Xavier Claessens f9200ca8f7 devenv: Set WINEPATH when cross compiling for Windows 2022-05-06 23:04:11 +03:00
Eli Schwartz 1e4d4fce22 coverage: be clever and detect config files for gcovr/lcov
gcovr will read this file anyway, but if it exists we don't need to
assume that the project wishes to exclude subprojects/ -- they can
determine that themselves.

Fixes #3287
Closes #9761

lcov doesn't read the config file by default, but we can do the smart
thing here.

Fixes #4628
2022-05-06 22:55:37 +03:00
Dudemanguy 557680f7d6 add prefer_static built-in option
By default, meson will try to look for shared libraries first before
static ones. In the meson.build itself, one can use the static keyword
to control if a static library will be tried first but there's no simple
way for an end user performing a build to switch back and forth at will.
Let's cover this usecase by adding an option that allows a user to
specify if they want dependency lookups to try static or shared
libraries first. The writer of the meson.build can manually specify the
static keyword where appropriate which will override the value of this
option.
2022-05-03 23:03:56 -04:00
Paolo Bonzini 3a960023d3 interpreter: new function add_project_dependencies()
This function can be used to add fundamental dependencies such as glib
to all build products in one fell swoop.  This can be useful whenever,
due to a project's coding conventions, it is not really possible to
compile any source file without including the dependency.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-03 02:00:29 -04:00
Remi Thebault d7e56f5ec9 complete documentation of declare_dependency 2022-05-02 23:06:38 +03:00
Remi Thebault 0f15bfb846 Fix wrong name in doc
The doc about declare_dependency states
d_module_features instead of d_module_versions
2022-05-02 23:06:38 +03:00
Eli Schwartz 5c0145c54d
docs: correct incorrect types for pch files
In the original RefMan 2.0 implementation, the types for this were
filled in as `str | file`, but the code only ever accepted the former.
Fix the documentation so that it aligns with reality.

Fixes #10338
2022-05-02 00:20:10 -04:00
Peter Lesslie d771fc7d0b Add support for multiline f-strings
+ Extend the parser to recognize the multiline f-strings, which the
documentation already implies will work.

The syntax is like:
```
x = 'hello'
y = 'world'

msg = f'''This is a multiline string.

Sending a message: '@x@ @y@'
'''
```

which produces:
```
This is a multiline string.

Sending a message: 'hello world'

```

+ Added some f-string tests cases to "62 string arithmetic" to exercise
the new behavior.
2022-05-01 12:47:37 -04:00
Maple e201b87dd5
Some documentation fix (#10335)
* update sample image

* increase size so all text will be shown
2022-05-01 13:24:38 +03:00
Jussi Pakkanen bba588d8b0
Merge pull request #10039 from eli-schwartz/wayland-protocols-subproject-files
dependencies: allow get_variable to expose files from subprojects
2022-05-01 00:01:03 +03:00
Remi Thebault 69e15377ce add release snippet 2022-04-30 10:07:38 -04:00
Fini Jastrow c16fdaeeca linkers: Add support for mold linker
[why]
Support for the relatively new mold linker is missing. If someone wants
to use mold as linker `LDFLAGS="-B/path/to/mold"` has to be added instead
of the usual `CC_LD=mold meson ...` or `CXX_LD=mold meson ...`.

[how]
Allow `mold' as linker for clang and newer GCC versions (that versions
that have support).

The error message can be a bit off, because it is generic for all GNU
like compilers, but I guess that is ok. (i.e. 'mold' is not listed as
possible linker, even if it would be possible for the given compiler.)

[note]
GCC Version 12.0.1 is not sufficient to say `mold` is supported. The
expected release with support will be 12.1.0.
On the other hand people that use the un-released 12.0.1 will probably
have built it from trunk. Allowing 12.0.1 is helping bleeding edge
developers to use mold in Meson already now.

Fixes: #9072

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-04-30 10:06:22 -04:00
Eli Schwartz c181f2c70b
Add small note that get_variable can publicize its data files
Nothing elaborate, just laying down the ground rules for expected usage
and pointing out that it now works. The idea is not to give people
ideas, but to let projects which already have this use case, use it with
confidence.
2022-04-27 23:45:02 -04:00
Ferdinand Thiessen 6f156e8ddd gnome: Use 'doc' install_tag for gnome.yelp 2022-04-27 09:29:38 -04:00
Paolo Bonzini e4d9ba5c9e improve help for -Ddebug
"Debug" is not a very helpful help message.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-27 08:37:31 -04:00
Simon Arlott 660bfa6e7c docs: Remove deprecated meson.source_root() from localisation page example
Meson already supplies the same value
2022-04-24 06:57:43 -04:00
Xavier Claessens 3c8343b483 Allow deprecating an option for a new one 2022-04-21 14:18:29 -04:00
Kirill Isakov 39dd1ff9e8 vcs_tag: handle non-str / non-file arguments
This makes vcs_tag behave like other commands so it accepts not only
string and file arguments, but also exe, custom_tgt, and
external_program.
2022-04-20 20:53:19 -04:00
Kirill Isakov 33aa803521 vcs_tag: document the already supported file arg 2022-04-20 20:53:19 -04:00
Fredrik Salomonsson 442fd7dc73 docs: Add documentation on pkgconfig.relocatable
- Documentation for the pkgconfig.relocatable module option in
Builtin-options. Gives an explanation on what it does, usefulness and
what error that can occur when using it.

- Add pkgconfig.relocatable release snippet. Similar to the
documentation in Builtin-options. Just a bit more brief.

- Add Pkgconfig to DataTests.test_builtin_options_documented in the
docs unit tests.
2022-04-19 17:35:08 -04:00
Peter Lesslie ab5ed4db09 Add note in docs that multiline f-strings are not supported
Companion to https://github.com/mesonbuild/meson/pull/10284
2022-04-15 11:08:22 -04:00
Eli Schwartz 19de032d20
docs: make upload target depend on building the docs
Manually running hotdoc's upload command does not guarantee the docs
have actually been built.
2022-04-14 18:37:04 -04:00
alex-tee 0176419bec Update Zrythm entry in Users.md
Fixed broken link and updated outdated description.
2022-04-12 14:48:25 -04:00
Daniel Mensinger 99f510a817 docs: YAML: Add `arg_flattening: false` where required 2022-04-07 17:16:26 -04:00
Daniel Mensinger f192ecd1ef docs: refman: Add `arg_flattening` support 2022-04-07 17:16:26 -04:00
Daniel Mensinger 0808ae1b3d docs: Document argument flattening 2022-04-07 17:16:26 -04:00