Commit Graph

1690 Commits

Author SHA1 Message Date
Xavier Claessens 598e968993 Add `meson devenv` command and meson.add_devenv() 2021-03-16 09:00:50 -04:00
Xavier Claessens 4fda4f5012 doc: Add External Project into the top dropdown menu 2021-03-10 18:31:44 +02:00
Laurin-Luis Lehning f7dd111333 Some documentation language adjustments & improved error messages 2021-03-10 08:55:22 -05:00
Laurin-Luis Lehning aa71452f1a Yet another documentation update 2021-03-10 08:55:22 -05:00
Laurin-Luis Lehning e124afa409 Fix release snippet still using the old fstring syntax 2021-03-10 08:55:22 -05:00
Laurin-Luis Lehning 3739780b0e Add syntax documentation with tentative version target 2021-03-10 08:55:22 -05:00
Laurin-Luis Lehning 2607510b18 Add failing test cases & release snippet 2021-03-10 08:55:22 -05:00
Dylan Baker 39bb7aa31f docs: add a couple words about system dependencies 2021-03-09 22:55:04 -08:00
Jussi Pakkanen d76345b4be Add address sanitizer support for Visual Studio. 2021-03-09 13:52:15 -08:00
Tristan Partin c83106ee38 Add str.replace() method 2021-03-09 06:27:58 -05:00
Peter Kjellerstedt 6226ac26ef minstall: Correctly set uid/gid of installed files
In commit caab4d3d, the uid and gid arguments passed to os.chown() by
set_chown() were accidentally swapped, causing files to end up with
incorrect owner/group if the owner and group are not the same.

Also update the documentation to better indicate which argument to
install_mode is which.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
2021-03-06 13:29:29 +02:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Michael Brockus fb59529458
Fix release notes typo [skip ci] 2021-03-04 15:49:37 -05:00
Chris Mayo 91e30fadc7
docs: Clarify compiler.cmd_array() (#8454)
Make it easier to understand that this array contains the compiler
command, not arguments to it, and may only have one element.
2021-03-04 20:09:08 +02:00
Amr Ojjeh 5ca2aa7ec0
Improved a paragraph [skip ci]
Made it easier to understand
2021-03-04 20:08:09 +02:00
Dylan Baker 1ac4358eae docs/faq: Add a section on user defined functions and macros [skip ci]
Fixes #3234
2021-03-01 15:10:51 -08:00
Jason Woodward 50af09de03 install_man locale support
Rather than having to manually build the locale aware man paths with

`install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')`

Support doing

`install_man('foo.fr.1', locale: 'fr')`
2021-02-27 14:35:23 +02:00
Stephen Gregoratto ec5fe58e6d Allow printing UserOptions in the summary 2021-02-26 10:28:00 -05:00
Tim-Philipp Müller ace22f21a7 meson: add .has_external_property() methods
Useful in case of boolean values to distinguish between a boolean
value having been set in the native/cross file and not having been
provided, which can't be achieved by passing a fallback parameter
to .get_external_property().
2021-02-26 10:15:17 -05:00
Riccardo Schirone c5aee36fa2 Add Rizin to the list of meson users 2021-02-26 07:06:28 -05:00
Dylan Baker aa4efc709e deprecated `meson.get_cross_property`
It's a pure subset of `get_external_property`, and has odd behavior in
host == build configurations. `get_external_property` is clear, and uses
the standard `native : bool` syntax to control host vs build properties
2021-02-25 15:18:39 -08:00
Xavier Claessens cef5cab23c Support multiple args in error()
Seems it got forgotten when that was added to warnings() and message().

Fixes: #8414.
2021-02-25 22:58:45 +02:00
Matthias Klumpp 4e5efd3897
Allow custom target output to be processed by generators 2021-02-25 20:53:41 +02:00
Jussi Pakkanen 74ebb1ba59 Clarify that wrap requests are for user submission. [skip ci] 2021-02-25 00:40:20 +02:00
Jussi Pakkanen 671647188c Add note about using Ninja on old Meson versions. [skip ci] 2021-02-23 22:00:19 +02:00
Xavier Claessens 2fabd4c7dc minstall: Add --skip-subprojects option
By default all subprojects are installed. If --skip-subprojects is given
with no value only the main project is installed. If --skip-subprojects
is given with a value, it should be a coma separated list of subprojects
to skip and all others will be installed.

Fixes: #2550.
2021-02-22 23:03:55 +02:00
Patryk Obara 36d9d7a96f docs/users: Add DOSBox Staging 2021-02-21 19:53:37 -05:00
Xavier Claessens b6804bf49c Substitute @CURRENT_SOURCE_DIR@ in run_target() and custom_target()
run_target() does some variable substitutions since 0.57.0. This is a
new behavior, and undocumented, caused by sharing more code with
custom_target(). More consistency is better, so document it now.

custom_target() was doing variable substitution in the past, because it
shared some code with generator(), but that was undocumented. Some
refactoring in 0.57.0 caused it to not replace @CURRENT_SOURCE_DIR@,
@SOURCE_DIR@, and @BUILD_DIR@ anymore. This patch adds back
@CURRENT_SOURCE_DIR@ and document it. It does not add back @SOURCE_DIR@
because it is duplicate with @SOURCE_ROOT@ that has a better name. Also
do not add back @BUILD_DIR@ which is duplicate of @PRIVATE_DIR@, and
not @BUILD_ROOT@ surprisingly, adding to the confusion.
2021-02-17 14:48:04 +02:00
Olexa Bilaniuk d1e945f442 Add optional -Dcuda_ccbindir= option and -ccbin flag to CUDA compiler.
Closes #8110.
2021-02-16 15:10:21 -05:00
Jussi Pakkanen 110457543d Add missing apostrophes. [skip ci] 2021-02-16 01:04:20 +02:00
Sam Thursfield f5bc0f33da
docs: Fix typo in release notes [skip ci]
Mismatched \` symbol was messing up the formatting.
2021-02-14 23:04:15 +02:00
Jussi Pakkanen 7d1b11d67b Add a release note entry for C++ modules which was missing. [skip ci] 2021-02-14 22:12:18 +02:00
Jussi Pakkanen 5d651e76b5 Set up release 0.57. 2021-02-14 21:28:44 +02:00
Luca Weiss 398df56298 Add Qt6 module 2021-02-07 22:43:00 +02:00
Jussi Pakkanen a855bcab1c
Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgen
Add a wrapper to the rust module for bindgen
2021-02-07 16:57:39 +00:00
Peter Hutterer 3f8585676b Make installing non-existing subdirs a supported feature
install_subdir() with a non-existing subdir creates the directory in the
target directory. This seems like an implementation detail but is quite useful
to create new directories for e.g. configuration or plugins in the installed
locations.

git bisect says this started with 8fe8161014.
Let's add a test for it and document it to make this behavior official.

Limitation: it can only create at the install_dir location, trying to create
nested subdirectories does not work and indeed creates the wrong directory
structure. That is a bug that should be fixed separately:

        install_subdir('blah',
                        install_dir: get_option('prefix'))
        install_subdir('sub/foobar',
                        install_dir: get_option('prefix'))
        install_subdir('foo/baz',
                        install_dir: get_option('prefix'))

        $ tree ../_inst
        ../_inst
        ├── baz
        ├── blah
        └── foobar

Fixes #2904
2021-02-07 12:38:31 +00:00
Jussi Pakkanen 034b81a09f
Merge pull request #8288 from bonzini/test-setup-exclude-suites
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-07 12:03:10 +00:00
Jussi Pakkanen 8b82ffa9e4
Merge pull request #8305 from xclaesse/run-target-env
run_target: Add env kwarg
2021-02-07 11:46:41 +00:00
Dylan Baker b28235428d rust: Add a module wrapper for bindgen
This has a couple of advantages over rolling it by hand:
1. it correctly handles include_directories objects, which is always
   handy
2. it correctly generates a depfile for you, which makes it more
   reliable
3. it requires less typing
2021-02-06 10:27:04 -08:00
Xiaotian Wu 233afde4cc add loongarch support 2021-02-06 15:16:04 +00:00
Dylan Baker 456844a4f3 vala: Disable unity builds
Our approach to unity builds with vala is broken, you cannot unify the
generated C files, as they contain duplicate symbols. We would need to
instead combine the files while they are still in their vala form, then
convert that to C and compile the unified C file.

This does not fix the linked issue, as this removed the ability to do
vala unity builds, but it does allow running vala with `--unity=on`.

Related: #5280
2021-02-05 16:31:33 -08:00
Xavier Claessens 522392e755 run_target: Add env kwarg
Re-implement it in backend using the same code path as for
custom_target(). This for example handle setting PATH on Windows when
command is an executable.
2021-02-05 17:53:09 -05:00
Xavier Claessens b5100fe86a gnome: Add post_install() method
Various GNOME projects have scripts that does similar task, better do it
directly in meson. This ensures it's done correctly regarding usage of
subprojects and pkg-config. See for example this gtk bug:
https://gitlab.gnome.org/GNOME/gtk/-/issues/3626.

Fixes: #8268
2021-02-05 15:08:47 -05:00
Luke Drummond 46e3480f7c Introduce `fs.read` to read a file as a string
Following #7890, this patch introduces the ability to read the contents
of a file to the fs module.

This patch introduces the ability to read files at configure time, but
has some restrictions:
    - binary files are not supported (I don't think this will prove a
    problem, and if people are wanting to do something with binary
    files, they should probably be shelling out to their own script).
    - Only files outside the build directory allowed. This limitation
      should prevent build loops.
Given that reading an arbitrary file at configure time can affect the
configuration in almost arbitrary ways, meson should force a reconfigure
when the given file changes. This is non-configurable, but this can
easily be changed with a future keyword argument.
2021-02-04 17:34:11 +00:00
Xavier Claessens 95c0790711 minstall: Add --dry-run option
Closes: #1281
2021-02-04 16:24:38 +00:00
Luca Weiss 673aff3595 Fix some typos in the release notes snippets 2021-02-03 11:15:14 -08:00
Jussi Pakkanen cd94cf8995
Merge pull request #8087 from dcbaker/submit/lto-extensions
Add option for thinLTO
2021-02-02 22:17:13 +00:00
Eli Schwartz 65b3d67c7e
doc: fix typos 2021-02-02 16:15:48 -05:00
Dylan Baker 6f532b72c8 Add support for LLVM's thinLTO
This uses a separate option, b_lto_mode. It works in conjunction with
b_lto_threads.

Fixes #7493
2021-02-02 12:42:48 -08:00
Dylan Baker bffc94b08f compilers: Add support for using multiple threads with lto
Both Clang and GCC support using multiple threads for preforming link
time optimizaions, and they can now be configured using the
`-Db_lto_threads` option.

Fixes #7820
2021-02-02 12:42:48 -08:00
Paolo Bonzini c7c2bc8db1 interpreter, mtest: introduce add_test_setup(exclude_suites: ...)
This new keyword argument makes it possible to run specific
test setups only on a subset of the tests.  For example, to
mark some tests as slow and avoid running them by default:

    add_test_setup('quick', exclude_suites: ['slow'], is_default: true)
    add_test_setup('slow')

It will then be possible to run the slow tests with either
`meson test --setup slow` or `meson test --suite slow`.
2021-02-02 11:23:33 +01:00
Jussi Pakkanen 474f4813c4 Capitalize "Meson" consistently as it is a proper name. [skip ci] 2021-01-31 19:49:20 +00:00
Paolo Bonzini 4bde7f31ae copy editing for 0.57 release notes [skip ci] 2021-01-31 15:11:30 +00:00
Xavier Claessens 6c6b5d77d6 add_install_script: add skip_if_destdir kwarg
It is common, at least in GNOME projects, to have scripts that must be
run only in the final destination, to update system icon cache, etc.
Skipping them from Meson ensures we can properly log that they have not
been run instead of relying on such scripts to to it (they don't
always).
2021-01-30 21:28:21 +00:00
Jussi Pakkanen f72ee8e742 Rewrap long text lines in docs. [skip ci] 2021-01-30 16:19:59 +00:00
Jussi Pakkanen c67e0a8a67
Merge pull request #8264 from xclaesse/ep-misc
external_project: misc improvements
2021-01-30 11:30:16 +00:00
Jussi Pakkanen f0fbb31ccf
Merge pull request #8200 from bonzini/mtest-asyncio-logs
mtest: improvements to logging
2021-01-30 09:52:43 +00:00
Xavier Claessens ef7dfa97fc external_project: Add release snippet 2021-01-29 19:02:48 -05:00
Jussi Pakkanen 3f0a0c1582 Can read project version from a file. 2021-01-29 16:42:59 +00:00
Xavier Claessens 11cfc258fc external_project: Add default configure options 2021-01-29 11:01:00 -05:00
Dylan Baker f808c955ea intepreter: Allow using file objects for the script_name of add_*_script
It's a bit silly and conveluted to have to call find_program on the
output of configure_file, so let's just allow passing files as the
script name.
2021-01-27 21:59:55 +00:00
Xavier Claessens 633264984b custom_target: Add env kwarg 2021-01-27 09:00:54 -05:00
Xavier Claessens e4137ae3ec test: Make timeout <= 0 infinite duraction 2021-01-27 08:26:20 -05:00
Xavier Claessens baa9eeebe4 dist: Allow packaging subproject in same git repo as main project 2021-01-26 21:32:03 -05:00
Florian Schmaus 0f5a136c40
docs: Fix sentence in Machine-files.md [skip ci]
Fixes: 1ca17dc853 ("docs/machine-files: Add a section on data types")
2021-01-26 08:09:53 -05:00
Evgeny Ermakov a24546d7da docs: Fix typo in Syntax.md [skip ci] 2021-01-23 17:25:51 +00:00
Paolo Bonzini ec02753fbf docs: add documentation snippet for meson test console output changes 2021-01-22 12:18:59 +01:00
Paolo Bonzini adb1b2f3f6 interpreter: accept external programs and dependencies for summary 2021-01-21 08:54:35 -05:00
Marios Staikopoulos f8681b12e1 MSVC and Clang-Cl Compiler Argument Cleanup
This commit performs some cleanup for the msvc and clang-cl arguments.

* "Disable Debug" (`/Od`) is no longer manually specified for optimization levels {`0`,`g`} (it is already the default for MSVC).
* "Run Time Checking" (`/RTC1`) removed from `debug` buildtype by default
* Clang-CL `debug` buildtype arguments now match MSVC arguments
* There is now no difference between `buildtype` flags and `debug` + `optimization` flags
2021-01-20 14:11:16 -05:00
Volker Weißmann 2e48d13fa2 Added "How do I use a library before declaring it?" in the FAQ. 2021-01-20 19:07:04 +00:00
Jussi Pakkanen 8133a7b9a4 Keep buildtype the same even if user changes debug and/or optimization. 2021-01-19 20:25:55 +00:00
Marios Staikopoulos a3d8dc546c Removal of /ZI on MSVC Debug
The /ZI flag adds in "Edit and Continue" debug information, which will
cause massive slowdown. It is not a flag that we should be adding by
default to debug builds.

/Zi will still be added.
2021-01-17 21:03:35 +00:00
Paolo Bonzini ea2f34e286 mtest: allow quickly interrupting the test run
The new behavior of interrupting the longest running test with Ctrl-C is useful
when tests hang, but not when the run is completely broken for some reason.
Psychology tells us that the user will compulsively spam Ctrl-C in this case,
so exit if three Ctrl-C's are detected within a second.
2021-01-14 22:00:51 +00:00
gaal-dev e3bd45c7c3
Add qtcreator to IDE-integration.md 2021-01-14 08:40:07 -05:00
Antonin Décimo 39ede12aa5 Fix misspells
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13 12:53:10 -05:00
Eli Schwartz adfcf77109
summary: align left, not align middle
aligning along the left is, I think, what most projects want to do.
Aligning along the middle looks subjectively ugly, and objectively
prevents me from further indenting an element, e.g.

  Build information:
    prefix                : /usr
    sysconfdir            : /etc
        conf file         : /etc/myprogram.conf
2021-01-12 19:19:00 -05:00
Luke Elliott 9efcdba0d5 Allow '//' as project function id due to git bash path conversion.
See https://stackoverflow.com/questions/54258996/git-bash-string-parameter-with-at-start-is-being-expanded-to-a-file-path
2021-01-12 17:42:57 +00:00
Eli Schwartz a0d54d0441
doc: fix invalid Commands.md example for introspect [skip ci]
It requires at least one option argument, and the one that provides
"basic information" about the project is --projectinfo, so let's use
that to demo the command.

Fixes #8182
2021-01-11 14:12:29 -05:00
Michael Brockus 72365e6856
Add Chicken-Libraries to Users.md (#8180) 2021-01-11 10:33:59 -05:00
Daniel Mensinger 8f1d9bb7b0 cmake: add PATH logic to preliminary dep check (fixes #8133) 2021-01-10 21:48:23 +00:00
Eli Schwartz c18a9715b8
Hotdoc: use template for Commands.md instead of generating the entire file (#8154)
* doc: fix hotdoc misuse for dynamically generated content

hotdoc has a native include feature for including files inline. Use this
to generate one file for each dynamically generated code block, and
include that file in Commands.md; see:
https://hotdoc.github.io/syntax-extensions.html#smart-file-inclusion-syntax

This permits us to move back to using the in-tree version of the hotdoc
*.md sources, thus fixing the incorrect inclusion of "builddir/" in the
"Edit on github" links which resulted from using copies as the source.

Fixes #8061

* doc: call the dummy file a "stamp" as it is a better known term
2021-01-10 14:48:34 +02:00
Jussi Pakkanen c9d9dacdbc
Merge pull request #7860 from dcbaker/wip/2020-10/rust-module
Add a rust module
2021-01-06 00:05:48 +00:00
Dylan Baker 3d80a88bd3 modules: Add an unstable-rust module
Like other language specific modules this module is module for holding
rust specific helpers. This commit adds a test() function, which
simplifies using rust's internal unittest mechanism.

Rust tests are generally placed in the same code files as they are
testing, in contrast to languages like C/C++ and python which generally
place the tests in separate translation units. For meson this is
somewhat problematic from a repetition point of view, as the only
changes are generally adding --test, and possibly some dependencies.

The rustmod.test() method provides a mechanism to remove the repatition:
it takes a rust target, copies it, and then addes the `--test` option,
then creates a Test() target with the `rust` protocol. You can pass
additional dependencies via the `dependencies` keyword. This all makes
for a nice, DRY, test definition.
2021-01-05 15:10:50 -08:00
Jussi Pakkanen f9dd75f213 Fix last mention of Python 3.5. [skip ci] 2021-01-05 11:48:58 -08:00
Dylan Baker d89ec98b47 mtest: Add support for rust unit tests
Rust has it's own built in unit test format, which is invoked by
compiling a rust executable with the `--test` flag to rustc. The tests
are then run by simply invoking that binary. They output a custom test
format, which this patch adds parsing support for. This means that we
can report each subtest in the junit we generate correctly, which should
be helpful for orchestration systems like gitlab and jenkins which can
parse junit XML.
2021-01-05 10:23:41 -08:00
Eli Schwartz 67ee65f47e
doc: restore accidentally removed images used in Getting-meson.md [skip ci]
Broken in commit 8a11cf357e

Fixes #8148
2021-01-03 20:41:35 -05:00
Jussi Pakkanen 8a11cf357e Add simple start page for beginners. [skip ci] 2020-12-22 18:08:47 +00:00
Eli Schwartz 55a3458d7b
Revert "add owl chess in Users.md [skip ci]"
This reverts commit 7092efabb5.

No longer exists. See:
https://github.com/mesonbuild/meson/pull/7592#issuecomment-747817950
2020-12-17 21:06:34 -05:00
Jussi Pakkanen d32d0d6b53
Merge pull request #7902 from bonzini/mtest-build-depends-only
mtest: only build what is needed for the tests
2020-12-15 21:21:50 +00:00
Jean-Michel Gorius 521a1b9921 docs: Update link to libspng [skip ci]
libspng moved from Gitlab to Github. Update the link to point to the new location.
2020-12-15 17:49:05 +00:00
Eli Schwartz 9a42779521
doc: fix typos for doubled words [skip ci]
"more more" is one place where we don't need more.

Fixes #8097
2020-12-14 21:24:34 -05:00
Paolo Bonzini 79e2c52a15 mtest: only build what is needed for the tests
It is a usual workflow to fix something and retest to see if it is fixed using a
particular test.  When tests start to become numerous, it becomes time consuming
for "meson test" to relink all of them (and in fact rebuild the whole project)
where the user has already specified the tests they want to run, as well as
the tests' dependencies.

Teach meson to be smart and only build what is needed for the test (or suite)
that were specified.

Fixes: #7473
Related: #7830
2020-12-14 10:53:36 +01:00
Christoph Reiter 8d04b3ce74 CI: Move all remaining jobs from travis-ci to GHA
Some changes:

* Set HOME to /root, since github mounts its own HOME and 'wine'
  (because of permissions) and 'dub' (can't find packages) don't
  like that.
* Remove the seccomp option, doesn't seem to be needed.
2020-12-11 13:45:11 -08:00
Florian Schmaus a7aba905a0 compilers: add support for c++20/gnu++20
Fixes #8084.
2020-12-10 00:30:48 +02:00
Xavier Claessens 0efcb0be5f pkgconfig: Respect variable ordering when passed as list
This fix a regression introduced in Meson 0.56.0 when using python 3.5.
Also mention in documentation that using a meson dict does not guarantee
ordering.

Fixes: #8074.
2020-12-10 00:28:34 +02:00
Thomas Weißschuh b3c869918b docs: fix "edit on GitHub" links 2020-12-10 00:26:28 +02:00
Jussi Pakkanen c21b04ba08 Add prelinking support for static libraries. 2020-12-03 22:58:07 +02:00
Jerry Casiano 6e39dcad2f
Update Vala Preprocessor section in documentation. Closes: #8040 [skip ci] 2020-11-29 23:51:47 +02:00
Paolo Bonzini 0deab2ee9e
compiler: allow non-built internal dependencies as arguments
Allow methods on the compiler object to receive internal dependencies,
as long as they only specify compiler/linker arguments or other
dependencies that satisfy the same requirements.

This is useful if you're using internal dependencies to add special
"-D" flags such as -DNCURSES_WIDECHAR, -D_XOPEN_SOURCE_EXTENDED or
-DGLIB_STATIC_COMPILATION.
2020-11-24 00:03:35 +02:00
Michael Brockus 9d651fe61e
add dependency recommendation [skip ci]
Co-authored-by: Eli Schwartz <eschwartz@archlinux.org>
2020-11-23 13:51:16 -05:00
Eli Schwartz 1db800bf67 doc: fix confusing use of "build" as a directory argument [skip ci]
In most places, we now refer to "builddir/" which is a lot less likely
to make people think it is a subcommand which needs to be used
literally.

This is a regression since commit 276d342eba
due to the existence of new docs which were added later on, using the
wrong form.
2020-11-22 18:29:55 -08:00
Jason Ekstrand 15bbf1ea75 Handle cmake dependencies which require a specified version
Some CMake packages fail to find at all if no version is specified.
This commit adds a cmake_version parameter to dependency() to allow you
to specify the requested version.
2020-11-21 07:55:10 -08:00
Jussi Pakkanen 913374834c
Merge pull request #7894 from obilaniu/cudaupdates
Update unstable CUDA Module to support newest toolkits and drivers.
2020-11-18 23:12:15 +02:00
Michael Brockus 188695f202
Update Tutorial.md [skip ci] 2020-11-18 23:02:28 +02:00
Jussi Pakkanen c8af3c8d29 Revert "Add thinlto support. Closes #7493."
This reverts commit 3e6fbde94c.
2020-11-17 17:51:23 +02:00
Eli Schwartz 98ddd472ed doc: add much-needed accuracy to pip installation instructions [skip ci]
- mention installing from local sources, not PyPI
- warn against --user installs, which too often screw up users that then
  cannot install projects because ~/.local won't be in sudo's PYTHONPATH
- advise installing with sudo -- current versions of pip assume --user
  for you rather than failing with permission errors, which is great
  unless, like meson, there are compelling reasons to need to install as
  root
2020-11-17 17:49:18 +02:00
Jussi Pakkanen 59cacbbfc1 Add doc on how to add the [provide] entry to wrapdb entries. [skip ci] 2020-11-14 13:47:55 +02:00
Eli Schwartz 8992729ade doc: fix typo [skip ci] 2020-11-12 12:46:29 -08:00
Jones 8351e85bbd
interpreter: Add get_keys function for configuration_data (#7887) 2020-11-12 20:43:17 +02:00
Jussi Pakkanen 3e6fbde94c Add thinlto support. Closes #7493. 2020-11-08 16:00:05 +02:00
Olexa Bilaniuk ea5dd189c5 Update documentation for CUDA module. 2020-11-05 14:50:23 -05:00
Michael Weiss cc033e5476
docs: Recommend to use SPDX license identifiers [skip ci]
Some license identifiers are ambiguous (e.g. "GPL3"). The SPDX license
identifiers avoid this by providing standardized and unique identifiers
(e.g. "GPL-3.0-only" or "GPL-3.0-or-later" for the previous example).

Because SPDX short-form identifiers are also both human- and
machine-readable we should recommend them in the documentation.

More information (advantages, details, etc.) can be found here:
- https://spdx.dev/resources/use/#identifiers
- https://spdx.dev/ids/

Fix #7905.
2020-11-05 21:28:12 +02:00
Dylan Baker 7860a6aeab rust: implement support for --edition
Using the std option, so now `rust_std=..` will work. I've chosen to use
"std" even though rust calls these "editions", as meson refers to
language versions as "standards", which makes meson feel more uniform,
and be less surprising.

Fixes: #5100
2020-11-05 21:24:20 +02:00
Johan Bjäreholt d58dcf26e7
docs: Fix broken anchor links [skip ci]
Apparently anchor links are case-sensitive and needs to be lowercase in hotdoc.
Prior to this change the anchor links were uppercase so the link did not refer to the anchor tag.

Likely that there are more occurrences around the docs than this, have not looked.
2020-11-05 21:10:57 +02:00
Eli Schwartz 478feb39ed qt module: fix error message typo, translation qresource accepts qm not ts
Fixes #7925
2020-11-04 17:23:34 +02:00
Jussi Pakkanen bca90722ec Bump minimum supported Python version to 3.6. Closes #6297. 2020-10-30 11:18:11 +02:00
Jussi Pakkanen f16d31607e Bump version number for release. This is the 10 000th commit! 2020-10-30 10:25:24 +02:00
Danilo Spinella e7009d439c Syntax.md: Fix variable used in substring example 2020-10-22 08:47:24 -04:00
Paolo Bonzini e36b1923e2 fix markdown issue 2020-10-19 09:40:31 -07:00
Xavier Claessens bcf369ea3c Fix consistency in variables kwarg
Share common code to extract the `variables` kwarg in
declare_dependency() and pkg.generate().
2020-10-16 18:09:56 +03:00
Daniel Mensinger 7c377e5a5d intro: Add extra_files key to intro output (fixes #7310) 2020-10-15 01:56:59 +03:00
Jussi Pakkanen 30d78f3981
Merge pull request #6968 from xclaesse/auto-promote
Merge wraps from subprojects into wraps from main project
2020-10-14 19:40:34 +03:00
Peter Harris 8b8a610ea4 vs: add static_from_buildtype to b_vscrt 2020-10-14 19:35:28 +03:00
Xavier Claessens 173c115834 Add wrap mode to disable auto promote 2020-10-13 17:55:16 -04:00
Xavier Claessens 6333ee88c1 Merge wraps from subprojects into wraps from main project
wraps from subprojects are now merged into the list of wraps from main
project, so they can be used to download dependencies of dependencies
instead of having to promote wraps manually. If multiple projects
provides the same wrap file, the first one to be configured wins.

This also fix usage of sub-subproject that don't have wrap files. We can
now configure B when its source tree is at
`subprojects/A/subprojects/B/`. This has the implication that we cannot
assume that subproject "foo" is at `self.subproject_dir / 'foo'` any
more.
2020-10-13 17:55:16 -04:00
Daniel Mensinger e36f713a7f include_type: Add CMake subporject dependency method (fixes #6879) 2020-10-13 23:51:25 +03:00
Jussi Pakkanen 3372c58ca6
Merge pull request #7816 from mensinda/cmCross
cmake: Cross compilation support
2020-10-13 23:38:51 +03:00
Nirbheek Chauhan 55cf399ff8 mtest: Allow filtering tests by subproject
You could always specify a list of tests to run by passing the names as
arguments to `meson test`. If there were multiple tests with that name (in the
same project or different subprojects), all of them would be run. Now you can:

1. Run all tests with the specified name from a specific subproject: `meson test subprojname:testname`
1. Run all tests defined in a specific subproject: `meson test subprojectname:`

Also forbid ':' in test names. We already forbid this elsewhere, so
should not be a big deal.
2020-10-13 19:01:15 +03:00
Daniel Mensinger f5c9bf96b3
cmake: Add cross docs 2020-10-13 17:04:20 +02:00
Xavier Claessens dccff1f2bc msubprojects: Handle wrap-file to wrap-git case 2020-10-13 11:12:49 +00:00
Xavier Claessens 3ade5bbd92 msubprojects: Handle change of URL in wrap-git 2020-10-13 11:12:49 +00:00
Jussi Pakkanen aae23dfff3
Merge pull request #7740 from bonzini/fallback-false
Allow blocking/forcing automatic subproject search
2020-10-12 17:50:14 +03:00
Jussi Pakkanen 7b1cc95c7f Update wrap maintenance documentation. [skip ci] 2020-10-10 22:14:34 +02:00
Paolo Bonzini 726b822054 dependency: support boolean argument "allow_fallback"
Sometimes, distros want to configure a project so that it does not
use any bundled library.  In this case, meson.build might want
to do something like this, where slirp is a combo option
with values auto/system/internal:

  slirp = dependency('', required: false)
  if get_option('slirp') != 'internal'
    slirp = dependency('slirp',
                       required: get_option('slirp') == 'system')
  endif
  if not slirp.found()
    slirp = subproject('libslirp', ...) .variable('...')
  endif

and we cannot use "fallback" because the "system" value should never
look for a subproject.

This worked until 0.54.x, but in 0.55.x this breaks because of the
automatic subproject search.  Note that the desired effect here is
backwards compared to the policy of doing an automatic search on
"required: true"; we only want to do the search if "required" is false!

It would be possible to look for the dependency with  `required: false`
and issue the error manually, but it's ugly and it may produce an error
message that looks "different" from Meson's.

Instead, with this change it is possible to achieve this effect in an
even simpler way:

  slirp = dependency('slirp',
                     required: get_option('slirp') != 'auto',
                     allow_fallback: get_option('slirp') == 'system' ? false : ['slirp', 'libslirp_dep'])

The patch also adds support for "allow_fallback: true", which is
simple and enables automatic fallback to a wrap even for non-required
dependencies.
2020-10-08 12:24:07 +02:00
Paolo Bonzini a4f1caa405 docs: improve documentation of subproject fallback
Automatic fallback to subprojects is complicated and should be
pointed out outside the "fallback" keyword argument.  It is also
surprising that fallback to a subproject will not happen if
override_dependency has already been used with the request
dependency.  Document all this.
2020-10-08 11:11:15 +02:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Dylan Baker 4b1c1d83c8 machinefiles: Allow keys to be stored case insensitive
This is required to make the various keys in the [user options] section
work the same as they do in the meson_options.txt file, where we don't
have any rules about case sensitivity.

There is some risk here. Someone may be relying on this lower by default
behavior, and this could break their machine files.

Fixes #7731
2020-10-05 08:59:45 -04:00
Nirbheek Chauhan 264939963f docs: Fixup find_program search path documentation [skip ci]
It was slightly wrong, and also make it a bullet point for easier
parsing.
2020-10-02 09:38:35 +00:00
Dylan Baker 20663564bd deprecated get_configtool_variable and get_pkgconfig_variable
The get_variable method is able to do everything they do and more,
making it generally more useful. Let's tell people to stop using the old
ones.
2020-10-01 12:35:42 -07:00
Rasmus Thomsen 1d04caff29 Document search order of find_program 2020-10-01 13:42:56 -04:00
Alexandros Theodotou a65fffd127 document keys() method of dictionary object [skip ci] 2020-10-01 09:21:46 -04:00
Dylan Baker 5aee8567b8 dependencies/curses: Add a system dependency
That calls find_library and has_header in conjunction to look for curses
implementations that are baked into the system without any other find
method.
2020-09-29 14:58:32 -07:00
Dylan Baker 7d11d7cf68 dependencies/curses: Add support for using the ncurses config tools
These are mostly duplicated with pkg-config, but maybe someone has one
but not another, and they're easy to turn on with the
ConfigToolDependency.
2020-09-29 14:58:32 -07:00
Dylan Baker 16d3513df6 docs/Dependencies Add missing curses documentation 2020-09-29 14:58:32 -07:00
Dylan Baker 137c3124e2
Merge pull request #7758 from dcbaker/submit/hdf5-factory
dependencies/hdf5: Convert to a dependency_factory
2020-09-29 14:55:38 -07:00
Jussi Pakkanen 5f70984403
Merge pull request #7772 from xclaesse/deprecate-source-root
Deprecate meson.build_root() and meson.source_root()
2020-09-29 19:24:25 +03:00
Jon Turney ff186b0526 Improve documentation about using shell in custom_target() [skip ci]
Add a note about the portability of using shell constructs in the
custom_target() command.
2020-09-29 19:22:50 +03:00
Jussi Pakkanen 01edd26baf Add old style command to tutorial. Closes #7793. [skip ci] 2020-09-28 18:26:29 +03:00
Xavier Claessens 7176b74fd6 Add meson.project_build/source_root() methods 2020-09-28 11:22:38 -04:00
Dylan Baker 54329eeed7 dependencies/hdf5: Use the correct compilers for the machine
Instead of the default ones, this is especially important when cross
compiling or when using compilers that aren't compatible with the
default ones.
squash! dependencies/hdf5: Use the actual system compilers
2020-09-25 11:11:46 -07:00
Dylan Baker b7cb30e175 dependencies/hdf5: Convert to a dependency_factory
Instead of a mega dependency that does everything, use a dependency
factory for config-tool and pkg-config
2020-09-25 11:11:46 -07:00
Xavier Claessens 55ea461993 Deprecate meson.build_root() and meson.source_root()
Those function are common source of issue when used in a subproject because they
point to the parent project root which is rarely what is expected and is a
violation of subproject isolation.
2020-09-23 12:14:32 -04:00
Nirbheek Chauhan 94ea9d97be docs: Clarify what literal strings mean [skip ci]
Someone on IRC was confused by this paragraph.
2020-09-21 15:36:24 +05:30
Jussi Pakkanen 13a8e1d26e Improve docs for creating new wraps. [skip ci] 2020-09-21 01:48:30 +03:00
Sebastian Meyer a24fde6fde
Add support for the CompCert C Compiler
* Add preliminary support for the CompCert C Compiler

The intention is to use this with the picolibc, so some GCC flags are
automatically filtered. Since CompCert uses GCC is for linking, those
GCC-linker flags which are used by picolibc, are automatically prefixed
with '-WUl', so that they're passed to GCC.

Squashed commit of the following:

commit 4e0ad66dca9de301d2e41e74aea4142afbd1da7d
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 14:20:39 2020 +0200

    remove '-fall' from default arguments, also filter -ftls-model=.*

commit 41afa3ccc62ae72824eb319cb8b34b7e6693cb67
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 14:13:55 2020 +0200

    use regex for filtering ccomp args

commit d68d242d0ad22f8bf53923ce849da9b86b696a75
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 13:54:36 2020 +0200

    filter some gcc arguments

commit 982a01756266bddbbd211c54e8dbfa2f43dec38f
Author: Sebastian Meyer <meyer@absint.com>
Date:   Fri Aug 28 15:03:14 2020 +0200

    fix ccomp meson configuration

commit dce0bea00b1caa094b1ed0c6c77cf6c12f0f58d9
Author: Sebastian Meyer <meyer@absint.com>
Date:   Thu Aug 27 13:02:19 2020 +0200

    add CompCert to meson (does not fully work, yet)

* remove unused import and s/cls/self/

fixes the two obvious LGTM warnings

* CompCert: Do not ignore unsupported GCC flags

Some are safe to ignore, however, as per
https://github.com/mesonbuild/meson/pull/7674, they should not be
ignored by meson itself. Instead the meson.build should take care to
select only those which are actually supported by the compiler.

* remove unused variable

* Only add arguments once.

* Apply suggestions from code review

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>

* Remove erroneous ' ' from '-o {}'.format()

As noticed by @dcbaker

* added release note snippet for compcert

* properly split parameters

As suggested by @dcbaker, these parameters should be properly split into multiple strings.

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>

* Update add_compcert_compiler.md

Added a sentence about the state of the implementation (experimental); use proper markdown

* properly separate arguments

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-09-15 21:51:21 +03:00
Xavier Claessens 67c0ec1640 InternalDependency: Add as_link_whole() method 2020-09-14 20:32:22 -04:00
Xavier Claessens 9d338200da external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other
build systems.

Closes: #4316
2020-09-13 13:54:47 -04:00
Xavier Claessens 14c1a6983d msubprojects: Allow comma separated list of types 2020-09-10 11:39:30 -04:00
Xavier Claessens a3ac25b0c3 msubprojects: Fix review comments 2020-09-10 11:39:30 -04:00
Xavier Claessens 1101144d86 doc: Update new `meson subprojects` behaviors 2020-09-10 11:39:30 -04:00
Jon Turney 1480fdfa9a Add release note snippet 2020-09-10 07:20:41 +00:00
Jon Turney fc0f0df74b Don't require build machine compilers for project() languages
This means that, in the common case of a simple meson.build which
doesn't contain any 'native: true' targets, we won't require a native
compiler when cross-compiling, without needing any changes in the
meson.build.
2020-09-10 07:20:41 +00:00
Daiki Ueno 7ad66e8a1a docs/Users: add p11-kit [skip ci]
Signed-off-by: Daiki Ueno <ueno@gnu.org>
2020-09-07 11:24:07 +02:00
Michal Sojka 28f15390b9
doc: Add missing method arguments [skip ci]
Documentation of most methods mentions method arguments enclosed in
parentheses. Two methods are an exception and we fix them here to make
the manual more consistent.
2020-09-06 20:26:14 +03:00
Krzysztof Małysa 49b3182748 docs: Fix typo in Reference-manual.md [skip ci] 2020-09-05 16:56:28 -04:00
Paolo Bonzini fa5c2363eb introspect: add test dependencies info to test/benchmark JSON
Add the ids of any target that needs to be rebuilt before running the
tests as computed by the backend, to the introspection data for tests and benchmarks.
This also includes anything that appears on the test's command line.

Without this information, IDEs must update the entire build before running
any test.  They can now instead selectively build the test executable
itself and anything that is needed to run it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-04 14:45:20 +02:00
Nirbheek Chauhan bfb8d25deb docs: Add a snippet for python 3.5 deprecation [skip ci] 2020-09-02 16:29:39 +00:00
Daniel Berrangé 0ec8bebae8 Add Entangle application to list of apps using Meson
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-02 12:00:51 +02:00
Michael Brockus 0755be5048 Add some forgotten values for "cpp_std" [skip ci] 2020-09-02 11:06:06 +02:00
Sebastian Engel ac8cc2106f Clarify the use of -Doption and alternatives [skip ci]
The -Doption=value style argument works for all builtin options,
and compiler options passed to meson. And some universal options,
have additional ways to be passed. However, base options (and compiler
options) do not have exactly the same ways of passing as universal
options.

This change adds a few pieces of information, which might get lost,
if the manual is not read serially.

[skip ci]
2020-08-30 23:38:51 +03:00
Daniel Mensinger 17439fa3e8 test: Add 'dir' support for installed files in test.json
This is useful for automatically generated docs (doxygen, hotdoc)
with a lot of generated files that may differ with different
versions of the generator.
2020-08-27 00:08:57 +00:00
Jussi Pakkanen 3a25efc056
Merge pull request #7581 from peterh/aix
Add AIX support
2020-08-25 23:58:17 +03:00
Eli Schwartz 1de1cc22e2 qt module: add qresource support to compile_translations
A common pattern in Qt5 applications is to embed translations in the
executable using the qresource system. In this case, the list of
translation files is already available in the .qrc file and there's no
good reason to duplicate this info in meson.build.

Let compile_translations optionally take a qrc input, in which case it
will go straight to generating the relevant translations and
rcc-generated .cpp, and directly return the thing users actually care
about -- the .cpp for linking.
2020-08-25 23:46:45 +03:00
Jussi Pakkanen fc13c90de3
Merge pull request #7600 from alexrp/master
Add C2x option support.
2020-08-23 00:26:44 +03:00
Alex Rønne Petersen 450155110c Add C2x option support. 2020-08-22 18:57:05 +02:00
Jussi Pakkanen c42298e146
Merge pull request #7447 from scivision/nvc
Add support for NVidia HPC SDK compilers
2020-08-22 18:31:56 +03:00
noasakurajin fbc6d50acc
added VS Code/Codium extention [skip ci] 2020-08-22 14:38:45 +03:00
Paolo Bonzini 01724071ee Virtualization 💖 Meson [skip ci]
There are a couple new users of Meson that might be worth mentioning.
502 commits later, Libvirt and QEMU have both switched!

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21 12:54:42 -04:00
Xavier Claessens 1c403e20e7 Interpreter: Fix c_stdlib usage
- Exceptions raised during subproject setup were ignored.
- Allow c_stdlib in native file, was already half supported.
- Eliminate usage of subproject variable name by overriding
  '<lang>_stdlib' dependency name.
2020-08-18 14:47:38 -04:00
Peter Harris 1b2708eb79 docs: add AIX preliminary support snippet 2020-08-17 21:21:33 -04:00
Michael Brockus 7092efabb5 add owl chess in Users.md [skip ci] 2020-08-15 07:47:22 -07:00
Michael Brockus ee2f32d0c7 Add paper rock scissors to Users.md [skip ci] 2020-08-15 12:01:51 +03:00
John Scott 96e7ebc162 Add that prefix keyword works for cc.get_define 2020-08-15 07:59:29 +00:00
Nirbheek Chauhan 146febd4f2 docs: Clarify some FAQs in the Tutorial [skip ci]
Clarifications that were observed to be needed when seeing a user try
the Tutorial for the first time at:
https://www.twitch.tv/videos/709237047?t=50m20s
2020-08-14 16:49:11 -04:00
Michael Brockus 352f05fe7c
Written a new paragraph for var naming recommendation (#7531) 2020-08-08 01:36:02 +03:00
Nirbheek Chauhan eeebfded85 Document VS backend from_buildtype behaviour change in release notes
Closes https://github.com/mesonbuild/meson/issues/7438
2020-08-05 16:40:53 +00:00
Dylan Baker 3040f3c8dc
Merge pull request #6597 from dcbaker/full-project-config
Set project and meson options in cross/native files
2020-08-02 10:03:13 -07:00
Ebrahim Byagowi 894623ad5a docs/users: Add HarfBuzz [skip ci]
Proudly a meson user now
2020-08-02 16:36:16 +03:00
Dylan Baker 3a4d8dde52 update version from 0.55. to 0.56 2020-08-01 22:00:06 -07:00
Dylan Baker 601789cc7c machine-files: deprecate the paths section 2020-08-01 22:00:06 -07:00
Dylan Baker 1ca17dc853 docs/machine-files: Add a section on data types
This attempts to clarify the usage of strings and arrays, as well as
document the boolean type that has been exposed via the project and
built-in options
2020-08-01 22:00:06 -07:00
Dylan Baker bbba6a7f36 Allow setting built-in options from cross/native files
This is like the project options, but for meson builtin options.

The only real differences here have to do with the differences between
meson builtin options and project options. Some meson options can be set
on a per-machine basis (build.pkg_config_path vs pkg_config_path) others
can be set on a per-subproject basis, but should inherit the parent
setting.
2020-08-01 22:00:06 -07:00
Alexis Jeandet 46a4557021 Doc: Added clarification on introspection files gen order [skip ci]
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2020-07-31 19:27:53 +02:00
Dylan Baker 54fb616278 docs/Machine-files: remove duplicate Properties section 2020-07-30 19:34:37 -07:00
Dylan Baker a6164ca5a8 Allow setting project options from cross or native files
This allows adding a `[project options]` section to a cross or native file
that contains the options defined for a project in it's meson_option.txt
file.
2020-07-30 19:34:37 -07:00
Matthew D. Scholefield bc2338efd3
Describe syntax of `meson configure [skip ci]
This makes it a lot easier for people to quickly figure out how to customize parameter.
2020-07-28 20:47:20 +03:00
Xavier Claessens c016401f95 coredata: Make warning_level per subproject builtin option 2020-07-22 19:19:50 -04:00
cmcneish a7a6a4833f
Add boost_root support to properties files (#7210)
* Add boost_root support to properties files

This commit implements `boost_root`, `boost_includedir`, and
`boost_librarydir` variable support to native and cross properties
files. The search order is currently environment variables, then
these variables, and finally a platform-dependent search.

* Add preliminary boost_root / boost_includedir tests

Each test contains a fake "version.hpp", as that's how boost detection is
currently being done. We look for this file relative to the root directory,
which probably shouldn't be allowed (it previously was for BOOST_LIBRARYDIR
but not for BOOST_ROOT). It also cannot help with breakage detection in
libraries, however it looks like this wasn't getting tested beforehand.

I've given the two unique version numbers that shouldn't be present in any
stock version of boost (001 and 002).

* Add return type to detect_split_root

* Return empty list when nothing found in BOOST_ROOT, rather than None

* Update boost_root tests

* Create nativefile.ini based on location of run_project_tests.py
* Add fake libraries to ensure boost_librarydir is being used

* Require all search paths for boost to be absolute

* Redo boost search ordering

To better match things like pkg-config, we now look through native/cross files,
then environment variables, then system locations for boost installations.

Path detection does not fall back from one method to the next for properties or
environment variables--if boost_root, boost_librarydir, or boost_includedir is
specified, they must be sufficient to find boost. Likewise for BOOST_ROOT and
friends. pkg-config detection is still optional falling back to system-wide
detection, for Conan.

(Also, fix a typo in test 33's nativefile)

* Correct return type for detect_roots

* Correct boost dependency search order in documentation

* Print debug information for boost library finding, to resolve CI issues

* Handle native/cross file templates in a more consistent way

All tests can now create a `nativefile.ini.in` if they need to use some
parameter that the testing framework knows about but they can't.

* Pass str--rather than PosixPath--to os.path.exists, for Python35

* Look for boost minor versions, rather than boost patch versions in test cases

* Drop fake dylib versions of boost_regex

* Prefer get_env_var to use of os.environ

* Correct error reporting for relative BOOST_ROOT paths

* Bump version this appears in. Also, change "properties file" to "machine file" as that appears to be the more common language.
2020-07-21 16:40:29 +02:00
Stéphane Cerveau 8f106a2b9a string: add substring method
This method aims to offer a simple way to 'substring'
an existing string with start and end values.
2020-07-20 20:04:01 -04:00
wb9688 4974fa39ac
Fix dirs typo in Vala docs [skip ci]
Co-authored-by: wb9688 <wb9688@users.noreply.github.com>
2020-07-19 22:41:36 +03:00