Commit Graph

1821 Commits

Author SHA1 Message Date
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
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
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
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 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
John Ericson 01a7aa0a4d Document and test env vars a bit better 2022-04-03 10:58:03 -07:00
Marvin Scholz 2cdddbab56 Add new debug() function
Adds a new debug() function that can be used in the meson.build to
log messages to the meson-log.txt that will not be printed to stdout
when configuring the project.
2022-03-30 06:57:30 -04:00
Önder Görmez aa495ff758 Fix typo 2022-03-27 08:25:30 -04:00
Eli Schwartz d82d1b0d86
docs: add missing docs for new pkgconfig feature
Added in commit 6240920c21 and documented
in release notes but not in module docs.
2022-03-27 07:08:59 -04:00
Xavier Claessens f2d21bf8a9 Make compilers list per subproject
Previously subprojects inherited languages already added by main
project, or any previous subproject. This change to have a list of
compilers per interpreters, which means that if a subproject does not
add 'c' language  it won't be able to compile .c files any more, even if
main project added the 'c' language.

This delays processing list of compilers until the interpreter adds the
BuildTarget into its list of targets. That way the interpreter can add
missing languages instead of duplicating that logic into BuildTarget for
the cython case.
2022-03-24 12:27:06 -04:00
Dylan Baker b5375eb90f docs/rust: fix markdown title
VSCode is perfectly happy with the trailing `---`, hotdoc only likes
`...` apparently.
2022-03-22 19:09:21 -04:00
Xavier Claessens 8867fb7999 interpreter: Make compiler options per-subproject 2022-03-22 17:20:48 -04:00
Tristan Partin 39f1d52e4a Add ability to add resources to jars
Previously Meson lacked the ability to add resources to jar files.

Fixes #9945
2022-03-22 13:21:26 +02:00
Jussi Pakkanen fb67adf3e6 Prepare the 0.62.0 release. 2022-03-21 23:24:01 +02:00
Eli Schwartz 68b8fbcf6d Revert "devenv: Set PYTHONPATH where we install python modules"
This reverts commit 79c6075b56.

# Conflicts:
#	docs/markdown/snippets/devenv.md
#	mesonbuild/modules/python.py
#	test cases/unit/91 devenv/test-devenv.py

PYTHONPATH cannot be reliably determined. The standard use case for
installing python modules with Meson is mixed pure sources (at least
`__init__.py`) and compiled extension_modules or configured files.
Unfortunately that doesn't actually work because python will not load
the same package hierarchy from two different directories, one a source
directory and one a (mandatory) out of tree build directory.

(It kind of can, but you need to do what this test case accidentally
stumbled upon, which is namespace packages. Namespace packages are a
very specific use case and you are NOT SUPPOSED to use them outside that
use case, so people are not going to use them just to circumvent Meson
devenv stuff as that would have negative install-time effects.)

Adding PYTHONPATH anyway will just lead to documentation commitments
which we cannot actually uphold, and confusing issues at time of use
because some imports *will* work... and some will *not*. The end result
will be a half-created tree of modules which just doesn't work together
at all, but because it partially works, users attempting to debug it
will spend time wondering why parts of it do import.

For any case where the automatic devenv would work correctly, it will
also work correctly to use `meson.add_devenv()` a single time, which is
very easy to manually get correct and doesn't provide any significant
value to automate.

In the long run, an uninstalled python package environment will require
"editable installs" support.
2022-03-15 11:22:59 +02:00
Jussi Pakkanen 69ade4f4cf
Merge pull request #9339 from dcbaker/submit/structured_sources
Structured Sources
2022-03-13 01:01:55 +02:00
Jussi Pakkanen 04ef7ec45d Add new env2mfile command. 2022-03-09 18:02:04 -05:00
Tristan Partin 2c03b2bb7f Move dataonly pkgconfig file to datadir/pkgconfig
dataonly files are architecture independent (lib vs lib64 for example).

Fixes #9902
2022-03-09 17:50:41 -05:00
Xavier Claessens eafb8a8e10 install: Add --strip option 2022-03-09 10:38:28 -05:00
Eli Schwartz 7cc4ca2cbb
Revert "Add new env2cross command."
This reverts commit e257a870fe.

The PR adding this command had infinitely hanging CI, and now that it is
merged to master we cannot get any CI on any PR to succeed.
2022-03-08 21:34:39 -05:00
Jussi Pakkanen e257a870fe Add new env2cross command. 2022-03-08 23:40:03 +02:00
Eli Schwartz 789f440f7c
docs: add forgotten documentation for the new openssl dependency 2022-03-07 22:51:40 -05:00
Dylan Baker c08b6e29d9 Add support for rust proc-macro crates 2022-03-07 18:35:31 -05:00
Dylan Baker ff4c283b3a docs: Add a document on using Rust in Meson
This is hardly complete, but it's a start.
2022-03-07 12:33:33 -08:00
Dylan Baker 9cf7a12561 docs: Add docs for structured_sources 2022-03-07 12:33:33 -08:00
Eli Schwartz 0f2f87a003
find_program: add a version() method to match the one for dependencies
It is often useful to check the found version of a program without
checking whether you can successfully find
`find_program('foo', required: false, version: '>=XXX')`
2022-03-06 19:41:21 -05:00
Eli Schwartz 8b573d7dc6
i18n.merge_file: do not disable in the absence of gettext tools
Disabling targets because the tools used to build them aren't available
is a pretty suspicious thing to do. Users who want this are probably, in
general, advised to check themselves whether it is possible to build
those targets with find_program(..., required: false)

The i18n.gettext() invocation is a bit unusual because the product of
running it is non-critical files, specifically, translation catalogs. If
users don't have the tools needed to build them, they may not be able to
use them either, because perhaps they have NLS disabled on their
platform or it's difficult to put it in the bootstrap path.

So, for this reason, it was made non-fatal and the message catalogs are
just not created, and the resulting build is still perfectly usable
*unless* you want to use it in another language, at which point it
"works" but the text is all inscrutable to the end user, and that's a
feature of the target platform.

That's an acceptable tradeoff for translation catalogs.

It is NOT an acceptable tradeoff for merge_file, which produces desktop
files or MIME database catalogs or other files which have crucial roles
to perform, without which the software in question simply doesn't work
at all. In such cases, this just fails to install crucial files, users
report bugs to the project in question, and the project adds
`find_program('xgettext')` to guarantee the hard error due to lack of
confidence in Meson.

Fixes #6165
Fixes #8436
2022-03-06 11:09:56 -05:00
Xavier Claessens e80a9c2cba wayland module: Allow building both client and server sides
- Change `scope` kwarg to `public` boolean default to false.
- Change `side`  kwarg to `client` and `server` booleans.
- Document returned values
- Aggregate in a single unit test because have lots of small tests
  increases CI time.

Fixes: #10040.
2022-03-06 06:31:43 -05:00
Darren Ng af9af219d8 [skip ci] fix syntax typo 2022-03-04 19:59:39 -08:00
Tristan Partin 498db2764c Add modules kwarg to JNI system dep
This allows someone to link against libjvm.so and libjawt.so.
2022-03-04 13:52:21 -05:00
Remi Thebault 5e4ea9f0f4 add release snippet for declare_dependency 2022-03-03 08:42:56 -08:00
Remi Thebault 037fa77c64 Document D features in `declare_dependency` 2022-03-03 08:42:56 -08:00
Tristan Partin 96b2469544 Rename JDK system dep to JNI
JNI is a more apt name because it currently only supports the JNI. I
also believe that CMake uses the terminology JNI here as well.

JNI is currently the only way to interact with the JVM through native
code, but there is a project called "Project Panama" which aims to be
another way for native code to interact with the JVM.
2022-03-02 16:23:09 -05:00
Tristan Partin 18147b91ff Deprecate java.generate_native_header() in favor of java.generate_native_headers()
After implementing a much more extensive Java native module than what
currently exists in the tests, I found shortcomings.

1. You need to be able to pass multiple Java files.
2. Meson needs more information to better track the generated native
   headers.
3. Meson wasn't tracking the header files generated from inner classes.

This new function should fix all the issues the old function had with
room to grow should more functionality need to be added. What I
implemented here in this new function is essentially what I have done in
the Heterogeneous-Memory Storage Engine's Java bindings.
2022-03-01 13:18:50 -08:00
Xavier Claessens 6acfe48f32 Allow setting method/separator in environment() and meson.add_devenv() 2022-02-28 09:03:27 -05:00
Xavier Claessens 24f224777d devenv: Add --dump option
It prints all envorinmente variables that have been modified. Can be
used by shell scripts that wish to setup their environment themself.
2022-02-28 09:03:27 -05:00
Xavier Claessens 30cdb2a280 devenv: Setup GDB auto-load scripts
When the project instals GDB helper scripts, copy them into
meson-private directory with the right tree layout and write a .gdbinit
script to load them automatically.
2022-02-28 09:03:27 -05:00