Commit Graph

2132 Commits

Author SHA1 Message Date
Dylan Baker c5b16ab8b9 modules/rust: Add a machine file property for extra clang args with bindgen
It's currently impossible to inject extra clang arguments when using
bindgen, which is problematic when cross compiling since you may need
critical arguments like `--target=...`. Because such arguments must be
passed after the `--` it's impossible to inject them currently without
going to something like a wrapper script.

Fixes: #11805
2023-06-27 11:53:18 -07:00
Dylan Baker 43f24060f3 modules/rust: Add a `link_with` kwarg to the test method
This was requested by Mesa, where a bunch of `declare_dependency`
objects are being created as a workaround for the lack of this keyword
2023-06-27 11:53:18 -07:00
Dan Hawson 8e879911ec Added a little more useful info to 'link_whole' documentation, describing the use of /LINKWHOLE with MSVC and the behaviour of re-exporting symbols of individual objects in a static library. 2023-06-27 20:22:11 +03:00
Jussi Pakkanen 9e1dc30f1f Add CppNorth talk. 2023-06-25 16:27:42 +03:00
Alyssa Ross ab17bd2393 rust: fix -C prefer-dynamic behavior
I noticed when building a project that uses a proc macro that Meson
passed -C prefer-dynamic for the executable, and not the proc macro,
while cargo passed -C prefer-dynamic for the proc macro, but not for
the executable.  Meson's behavior broke setting -C panic=abort on the
executable.

As far as we can tell, because we explicitly pass each library path to
rustc, the only thing -C prefer-dynamic affects in Meson is how the
standard libraries are linked.  Generally, one does not want the
standard libraries to be dynamically linked, because if the Rust
compiler is ever updated, anything linked against the old standard
libraries will likely break, due to the lack of a stable Rust ABI.
Therefore, I've reorganised Meson's behavior around the principle that
the standard libraries should only be dynamically linked when Rust
dynamic linking has already been opted into in some other way.  The
details of how this manifests are now explained in the documentation.
2023-06-21 18:05:16 -04:00
Paolo Borelli 548dd25c67 Clarify `environment` docs.
The object is not used only for tests, but also for `custom_target` etc.
2023-06-21 08:45:47 -04:00
Xavier Claessens 4c85a7af92 doc: Dictionaries are ordered since Meson 0.62.0
This is a side effect of requiring Python >= 3.7 which itself guarantees
dictionary order. This is now a Meson language guarantee as well which
is required for passing default_options as dict and is generally
expected by users.
2023-06-20 16:10:20 -07:00
Xavier Claessens 6f2956e76c interpreter: Accept more types in default_options dict values 2023-06-20 16:10:20 -07:00
Dylan Baker be20e0809f interpreter: allow default_options and override_options as a dict 2023-06-20 16:10:20 -07:00
Martin Dørum e869a09bc2 add str.splitlines method
The new splitlines method on str is intended to replace usage of
fs.read('whatever').strip().split('\n').
The problem with the .strip().split() approach is that it doesn't have a
way to represent empty lists (an empty string becomes a list with one
empty string, not an empty list), and it doesn't handle Windows-style
line endings.
2023-06-20 08:28:47 -04:00
Jussi Pakkanen b0d2a92584 Add kernel and subsystem properties to machine objects. 2023-06-19 18:03:57 +03:00
Sébastien Villemot f2f42318ed Fix name of boost_includedir property 2023-06-08 14:31:01 -04:00
Tristan Partin 58aa301acc Override find_program('meson')
This override transparently upgrades anyone using it to this better
functionality.

Fixes #8511
2023-06-06 10:07:36 -04:00
Nathan Kidd e20717ed8f docs: List vc++20 for cpp_std
vc++20 support was added in 012ec7d5b3
2023-06-02 08:32:07 -07:00
Dylan Baker ada2a976f0
mlog: use a hidden class for state
This is a pretty common pattern in python (the standard library uses it
a ton): A class is created, with a single private instance in the
module, and then it's methods are exposed as public API. This removes
the need for the global statement, and is generally a little easier to
reason about thanks to encapsulation.
2023-05-31 17:20:44 -04:00
Nicholas Vinson 5689ecffa3 add refivar to users.md 2023-05-26 06:56:47 -04:00
Nicholas Vinson 9eb388a44d Update Users.md
fix package ordering to so Q* and r* packages are in alphabetical order.
2023-05-26 06:56:47 -04:00
Charles Brunet e7b9dfac98 mtest: wildcard selection
Allow the use of wildcards (e.g. *) to match test names in `meson test`.

Raise an error is given test name does not match any test.

Optimize the search by looping through the list of tests only once.
2023-05-25 13:44:13 -04:00
Eli Schwartz 2c806099c7
repair install_mode support for uid/gid effectively everywhere
We silently dropped all integer values to install_mode since the
original implementation of doing this in KwargInfo, in commit
596c8d4af5.

This happened because install_mode is supposed to convert False
(exactly) to None, and otherwise pass all arguments in place. But a
generator is homogeneous and attempting to do this correctly produced a
mypy error that FileMode arguments were allowed to be ints -- well of
course they are -- so that resulted in the convertor... treating ints
like False instead, to make mypy happy.

Fixes #11538
2023-05-24 19:05:06 -04:00
Pablo Correa Gómez e65f741e79 docs: gnome: mention that compile_resources adds dependencies by default
It is not very clear from the documentation that the dependencies in the
resource file are added as default dependencies to the target.
2023-05-23 23:07:16 -04:00
Nirbheek Chauhan 11a4cb7aad docs: Fix some typos in feature option examples 2023-05-23 18:24:08 -04:00
Volker Weißmann 12a2dc86ca Allow generator.process(generator.process(...))
Fixes #1141
2023-05-21 22:12:57 +03:00
Eli Schwartz 10d6d2860c
docs: mention additional python modules needed for building
Also check that they are available in meson.build.

Closes #11772
2023-05-09 21:33:33 -04:00
Eli Schwartz 53f43605ce
docs: make the man page installable
Users now have the *option* to run the documentation build and use
`meson install` to install man pages.
2023-05-09 21:33:32 -04:00
Eli Schwartz 6f78db93bf
docs: add option to skip building HTML docs
Reorder meson targets to handle those all at the end, and exit early if
HTML documentation is disabled. This makes it possible to build just the
manpage, without hotdoc installed.
2023-05-09 21:33:32 -04:00
Eli Schwartz 740d926eee
docs: add meson option to use the unsafe loader 2023-05-09 19:48:42 -04:00
Jussi Pakkanen 9de07ff4d7
Enable fatal warnings in HotDoc when building website. 2023-05-09 18:36:25 -04:00
Joel Rosdahl aab4a0c163 docs/prebuilt: fix sanity check logic in the example 2023-05-08 14:54:01 -04:00
Nomura c1fce8f60f Initial support for Metrowerks Assembler 2023-05-06 19:57:06 +03:00
Xavier Claessens 4ed5c0eefa doc: Add link to argument details 2023-05-03 15:06:35 -04:00
Renan Lavarec e94de2b872 Visual studio: Generate vcxproj.filters files to adds filters to imitated directories to navigate more easily in the source files. 2023-05-03 17:49:05 +03:00
Eli Schwartz 0e7fb07f91
python module: add an automatic byte-compilation step
For all source `*.py` files installed via either py.install_sources() or
an `install_dir: py.get_install_dir()`, produce `*.pyc` files at install
time. Controllable via a module option.
2023-05-02 19:28:35 -04:00
Charles Brunet 51b9f2f1a5 Find python3.xx on windows 2023-05-02 17:52:10 -04:00
Volker Weißmann 38b35eca30 Add env kwarg to gnome.generate_gir().
Fixes #384
2023-04-26 14:51:10 -04:00
Matthieu Bouron 09ec4f6e22 dependencies: allow to fallback on CMake to find the SDL2 library
On Windows, the SDL2 library is generally provided with only CMake config
files. This commit allows meson to fallback on CMake as a last resort to
find the SDL2 library.
2023-04-24 11:41:55 -04:00
Nomura 18cfa545f0 Initial support for Metrowerks C/C++ compiler 2023-04-24 09:07:37 -04:00
Sebastian Dröge 01420bf8fc rust: Add new `rust_dependency_map` target configuration
This allows changing the crate name with which a library ends up being
available inside the Rust code, similar to cargo's dependency renaming
feature or `extern crate foo as bar` inside Rust code.
2023-04-21 15:35:06 -04:00
Dylan Baker 474e3ea8af docs: update the Rust bindgen docs to talk about assertions
Since we now guarantee that Rust and C/C++ will have assertions both on
or both off, we can give guidance about using `cfg(debug_assertions)` to
wrap code using `#ifdef NDEBUG`.
2023-04-21 15:18:56 +05:30
Dylan Baker c62989ce80 rust: add support for b_ndebug
Rust has a `debug_assert!()` macro, which is designed to be toggled on
the command line. It is on by default in debug builds, and off by
default in release builds, in cargo. This matches what meson's b_ndebug
option does in `if-release` mode.
2023-04-21 15:18:56 +05:30
Charles Brunet 5eb55075ba intro: add more details to generated json files
This will help with the writing of tools to generate
VisualStudio project and solution files, and possibly
for other IDEs as well.

- Used compilers a about `host`, `build` and `target` machines
  arere listed in `intro-compilers.json`
- Informations lister in `intro-machines.json`
- `intro-dependencies.json` now includes internal dependencies,
  and relations between dependencies.
- `intro-targets.json` now includes dependencies, `vs_module_defs`,
  `win_subsystem`, and linker parameters.
2023-04-20 18:31:39 +03:00
Charles Brunet fbab1488ae extra_files keyword in declare_dependency() 2023-04-20 18:31:39 +03:00
Volker Weißmann 8d2a9e6e5c Update Users.md [skip ci] 2023-04-17 13:03:41 -04:00
Josh Soref cf9fd56bc9 fix various spelling issues
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11 19:21:05 -04:00
HiPhish 439a61affa Change "can not" to "cannot" throughout project
The word "cannot" expresses inability to do something whereas "can not"
expresses the ability to refrain from doing something.
2023-04-11 17:10:01 +03:00
Pete Dietl a912193fd8 Fix spelling and grammar in Dependencies.md 2023-04-11 12:44:16 +03:00
Jussi Pakkanen 994ba8b549 Generate relnotes for 1.1.0. 2023-04-10 18:39:03 +03:00
Xavier Claessens b30cd5d2d5 Make --vsenv a readonly builtin option
We need to remember its value when reconfiguring, but the Build object
is not reused, only coredata is.

This also makes CLI more consistent by allowing `-Dvsenv=true` syntax.

Fixes: #11309
2023-03-29 09:33:41 -04:00
Xavier Claessens 728c8dce24 doc: Use better name for builtin/return object title
The title is used only in the sidebar. There is no need to have
"extends" information there. For returned objects the actual name is not
meaningful so it's better to use the long name. For builtin objects the
name is important because that's the global variable name.
2023-03-28 14:56:47 -04:00
Xavier Claessens 748a1db1f8 doc: Fix some broken links 2023-03-28 21:46:32 +03:00
Dylan Baker be092c252e docs: replace most uses of `meson_options.txt` with `meson.options`
I've left the old release notes in place, but updated everything else to
use `meson.options`
2023-03-28 15:01:10 +03:00