Commit Graph

9980 Commits

Author SHA1 Message Date
Xavier Claessens 0c95d92404 pkgconfig: InternalDependency's ext_deps should be private by default
This fixes a regression introduced by
https://github.com/mesonbuild/meson/pull/7488.

InternalDependency's ext_deps previously where simply ignored, but that
PR has effect to add many more public Requires in generated pc files.
2020-10-17 15:53:46 +03:00
Jussi Pakkanen 66d3747efe
Merge pull request #7859 from mensinda/cmBlacklist
cmake: ignore CMAKE_TOOLCHAIN_FILE and CMAKE_PROJECT_INCLUDE
2020-10-17 12:35:35 +03:00
Xavier Claessens ed70c6df52 Subprojects should not inherit parent override
This was the behaviour in 0.55.0, so this test was assuming a behaviour
change. Revert it to the behaviour we had in 0.55.0.
2020-10-16 17:42:24 -04:00
Xavier Claessens 7271b1e942 Machine file pkg_config_path overrides environment
This is consistent with c_args in machine file overriding CFLAGS from
env. This also spotted an issue where in a native build this resulted
in pkg_config_path being /bar instead of /foo:
`-Dpkg_config_path=/foo -Dbuild.pkg_config_path=/bar`

Fixes: #7573
2020-10-16 17:42:24 -04:00
Xavier Claessens 254b836bd4 Add test case for "subproject:opt" in project()
This is regression test for #7573
2020-10-16 17:42:24 -04:00
Xavier Claessens 7902d2032d Refactor handling of machine file options
It is much easier to not try to parse options into complicated
structures until we actually collected all options: machine files,
command line, project()'s default_options, environment.
2020-10-16 17:42:24 -04:00
Daniel Mensinger 36cde6f91e
cmake: Ignore additional internal CMake variables 2020-10-16 22:43:20 +02:00
Daniel Mensinger 5f1da86a9b
cmake: ignore CMAKE_TOOLCHAIN_FILE and CMAKE_PROJECT_INCLUDE to avoid conflicts with the meson CMake logic 2020-10-16 20:44:04 +02:00
Carlos Bederian c3b3dc598e compilers/cuda: Use format_map(mapping) instead of format(**mapping) 2020-10-16 18:18:46 +02:00
Carlos Bederian 71be873be2 Add CUDA compiler header symbol tests 2020-10-16 18:18:46 +02:00
Carlos Bederian f09457a1e8 compilers/cuda: Fix has_header_symbol check 2020-10-16 18:18:46 +02: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
Xavier Claessens 2e80c52129 windows: Avoid target name clash happening in GTK+ 2020-10-15 23:07:29 +03:00
mimi89999 4d140eb830 gnome: generate cpp gresource source in cpp projects
Closes #7839
2020-10-15 08:09:51 -04: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 3a01823786 wrap: Add 'redirect' type and use it when auto promote 2020-10-13 17:55:16 -04:00
Xavier Claessens 173c115834 Add wrap mode to disable auto promote 2020-10-13 17:55:16 -04:00
Xavier Claessens a20d7ad67d wrap: Use sub-subproject packagefiles 2020-10-13 17:55:16 -04:00
Xavier Claessens 8281bd9e23 interpreter: Improve message when fallback dependency is not found
- Log the message before raising the exception.
- Add a reason when the dependency is not found because the subproject
  failed to configure, because it was not obvious in the case the
  subproject failed to configure earlier while looking for an optional
  dependency.
- Avoid double message when the subproject has overriden the dependency
  and we provided the fallback variable as well.
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
Xavier Claessens 311a07c39a interpreter: Rename dirname to subp_name
dirname is confusing because the name of a subproject does not always
match its directory name, the wrap file can define another directory.
For example foo.wrap will often extract the subproject into foo-1.2
directory, in that case the subproject name is 'foo' and the subproject
directory is 'foo-1.2'.
2020-10-13 17:53:05 -04:00
Daniel Mensinger e36f713a7f include_type: Add CMake subporject dependency method (fixes #6879) 2020-10-13 23:51:25 +03:00
Daniel Mensinger e00df9046d include_type: honor include_type in dependency fallbacks (fixes #7503) 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
Daniel Mensinger b27af7e465
cmake: Add cross tests 2020-10-13 17:04:20 +02:00
Daniel Mensinger 7e58f33376
cmake: Add cross compilation support 2020-10-13 17:04:19 +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
Daniel Mensinger 47046c3fb9 ci: fix fedora image 2020-10-13 00:30:31 +02:00
Daniel Mensinger 392bdcbddd cuda: Also read CUDART_VERSION from cuda_runtime_api.h 2020-10-13 00:30:31 +02:00
Daniel Mensinger f6b346f2e2 ci: Add an interactive mode (testTTY) for the CI image builder 2020-10-13 00:30:31 +02:00
Michele Dionisio eef880f509 exclude generated file from clang-tidy processing
by default run_clang_tidy process al file in compile_commands.json but
the file generated has to be esclude like already done from
manual_clangformat
2020-10-12 18:17:15 +03: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
Camilo Celis Guzman ba71fde186 mtest: collect failures regardless of colorized console 2020-10-12 00:51:21 +03:00
Daniel Mensinger 96c31d9dbc typing: fix mypy typing error 2020-10-12 00:23:59 +03:00
Jussi Pakkanen 7b1cc95c7f Update wrap maintenance documentation. [skip ci] 2020-10-10 22:14:34 +02:00
Sahnvour f80dcb4f33 add test case for #6365 2020-10-10 04:28:16 +00:00
Sahnvour 206e9e5097 Properly handle the case of linking static library with custom targets 2020-10-10 04:28:16 +00: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 1eec5cf41f interpreter: clean up handling of force_fallback
Force_fallback is not an interpreter keyword argument, and there
is no reason to handle it as one since it is not used anywhere
else (and in fact is explicitly ignored by get_dep_identifier).
Use a Python keyword argument instead, which makes the code
simpler.
2020-10-08 12:23:46 +02:00
Paolo Bonzini 862bc146a8 interpreter: refactor handling of dependency(fallback: ...) 2020-10-08 11:12:36 +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
Xavier Claessens 9295aedb8d Tests: py.dependency() now has required:true by default
It used to ignore the required argument and got fixed to be consistent
with dependency() function.
2020-10-07 19:08:17 +02:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Xavier Claessens 8b20852b0f python.dependency() is not respecting 'required' kwarg 2020-10-06 19:15:59 -04:00
Dylan Baker 88fecedc77 environment: provide a more detailed explanation of linker detection failures
Just saying "it failed" is accurate, but not useful to helping someone
figure out why it failed. Giving them the stdout and stderr (like we
might with compilers) should help people resolve the issue.

Fixes: #7173
2020-10-06 23:06:28 +03:00