Commit Graph

2481 Commits

Author SHA1 Message Date
e8399c8c6e depenencies/llvm: Handle llvm-config --shared-mode failing (#7379)
* depenencies/llvm: Handle llvm-config --shared-mode failing

Fixes: #7371
Fixes: #7878

* test cases/llvm: Refactor to use test.json

Instead of trying to cover everything internally
2020-10-22 17:21:14 +03:00
64f8479097 In text, betterer grammer usings. 2020-10-19 00:04:14 +03:00
a050db5e30 Fix gnome.compile_resources() when glib is a subproject
When glib is a subproject we should use glib-compile-resources it
overrides using find_program() in the case it is not installed on the
build machine. With old glib version we have to run
glib-compile-resources at configure time to generate the list of
dependencies, but not when glib is recent enough.
2020-10-17 22:25:57 +03:00
254b836bd4 Add test case for "subproject:opt" in project()
This is regression test for #7573
2020-10-16 17:42:24 -04:00
71be873be2 Add CUDA compiler header symbol tests 2020-10-16 18:18:46 +02:00
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
7c377e5a5d intro: Add extra_files key to intro output (fixes #7310) 2020-10-15 01:56:59 +03:00
a20d7ad67d wrap: Use sub-subproject packagefiles 2020-10-13 17:55:16 -04:00
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
e36f713a7f include_type: Add CMake subporject dependency method (fixes #6879) 2020-10-13 23:51:25 +03:00
e00df9046d include_type: honor include_type in dependency fallbacks (fixes #7503) 2020-10-13 23:51:25 +03:00
b27af7e465 cmake: Add cross tests 2020-10-13 17:04:20 +02:00
aae23dfff3 Merge pull request #7740 from bonzini/fallback-false
Allow blocking/forcing automatic subproject search
2020-10-12 17:50:14 +03:00
f80dcb4f33 add test case for #6365 2020-10-10 04:28:16 +00:00
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
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
1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
94ac51fdda options: Handle updates to choices in options
Currently if you change the `choices` field in the meson_options.txt
file, no update will be done until `meson setup --wipe` is called. Now
if the choices change then the options will be properly merged.

If the currently select value is still valid it is guaranteed to be
kept, if it is now invalid the new default value will be used and a
warning will be printed.

Fixes #7386
2020-10-05 23:10:35 +03:00
c4fa876925 Never run clang-format / clang-tidy against directories
`pathlib.Path.glob()` also returns directories that match source
filenames (i.e. a directory named `test.h/`), but `clang-format` and
`clang-tidy` fail when handed a directory. We manually skip calling
`clang-format` and `clang-tidy` on those directories.
2020-10-05 23:07:20 +03:00
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
962ea8053b Added subdir files test 2020-10-04 14:52:28 +02:00
77b5c82d07 cmake: switch to pathlib (fixes #7322) 2020-10-04 10:45:48 +02:00
19f2b3d583 tests/curses: Extend to test versions
This is mostly important for the system dependency where we need to roll
the version check ourselves.
2020-09-29 14:58:32 -07:00
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
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
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
400ec2d685 Merge pull request #7762 from jon-turney/meson-exe-output-improve
Improve the output for meson wrapped commands
2020-09-29 19:28:51 +03:00
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
7176b74fd6 Add meson.project_build/source_root() methods 2020-09-28 11:22:38 -04:00
75433bee74 Fixes meson test timeout on windows
```
2020-09-23T01:25:14.7849070Z
2020-09-23T01:25:14.7849592Z 1/5 Boost linktest      TIMEOUT        30.16s
2020-09-23T01:25:14.7849811Z
2020-09-23T01:25:14.7850027Z --- command ---
2020-09-23T01:25:14.7850281Z 01:24:30 D:\a\1\s\b 125f976e40\linkedexe.exe
2020-09-23T01:25:14.7850561Z -------
2020-09-23T01:25:14.7850693Z
2020-09-23T01:25:14.7850947Z 2/5 Boost UTF test      TIMEOUT        31.15s
2020-09-23T01:25:14.7851141Z
2020-09-23T01:25:14.7851347Z --- command ---
2020-09-23T01:25:14.7851580Z 01:24:30 D:\a\1\s\b 125f976e40\utf.exe
2020-09-23T01:25:14.7851862Z --- stdout ---
2020-09-23T01:25:14.7852065Z Running 1 test case...
2020-09-23T01:25:14.7852441Z
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
2020-09-27 22:32:52 +03:00
bffd981246 tests/hdf5: work around some problems
There are two cases that won't work (these are taken from fortran/9
cpp), using gfortran with a non-gcc compiler on windows, or using
gfortran with apple clang. The latter is due to default search paths,
which we can fix, but is out of scope for this MR.
2020-09-25 11:11:46 -07:00
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
bd16b4846f Add a test of a failed pickled command 2020-09-21 14:01:31 +01:00
9b8ac9db32 project tests: Verify that UWP cross binaries use the right arch
This is a test for https://github.com/mesonbuild/meson/pull/7021, to
verify that `link.exe` uses the correct architecture when targeting
ARM64. Can be extended to other cross targets later.
2020-09-17 22:25:37 +00:00
67c0ec1640 InternalDependency: Add as_link_whole() method 2020-09-14 20:32:22 -04:00
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
a908404e6d Fix test 'common/122 llvm ir and assembly' for Windows ARM 2020-09-11 20:45:09 +00:00
1d5fef89f0 Skip test 'common/121 shared modules' on Windows UWP 2020-09-11 20:45:09 +00:00
88e13c5f7c Split tests out from 'common' which require a native compiler
Split out tests (and parts of tests) which require a native compiler
from the 'common' suite to a new suite called 'native', so we can
selectively avoid running those tests when only a cross-compiler is
available.

Also move test '211 cmake module' to 'cmake' suite, since it appears
that the way we use cmake requires a native compiler.
2020-09-10 07:20:41 +00:00
79b2eeb1ba Identify machine in error accesing compiler object for missing language
Also add a failing test case for that error.
2020-09-10 07:20:41 +00:00
4cef45af21 cmake: fix shared_module dependency (fixes #7715) 2020-09-10 06:41:24 +00:00
8d54b7bda3 Merge pull request #7428 from jon-turney/introspector-add-languages
Handle add_languages(native:) in introspector
2020-09-09 19:51:28 +03:00
461c14b8b7 Add a test of add_languages(native:) introspection
If the meson.build doesn't use a native compiler, the native compiler
options (e.g. 'c_args') shouldn't be present in the output of 'meson
introspect --buildoptions'.
2020-09-09 15:06:02 +01:00
4ed5c3acbf IntrospectInterpreter: allow dictionaries with nonconstant keys
Something like {a: foo} currently stymies the IntrospectionInterpreter and
breaks introspection of the source directory.  The fix is just to walk the keys
and return a dummy dictionary.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 19:56:20 +02:00
97177bc12a Merge pull request #7689 from scivision/fortran_inc
correct Fortran include algorithm
2020-09-06 20:28:39 +03:00
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
d01fc3da8f tests: add fortran cmake subproject include test
ci:unused_arg: update ninja version to work with fortran+cmake
2020-09-03 00:20:07 -04:00
0b0873c743 cuda: bump CUDA version since 3.0 is no longer supported 2020-09-02 23:15:06 +03:00
9365486104 Special case meson.version().version_compare() statement
when that statement gets evaluated, the interpreter remembers the
version target and if it was part of the evaluation of a `if` condition
then the target meson version is temporally overriden within that
if-block.

Fixes: #7590
2020-09-02 12:55:31 -04:00
56ebd5c740 Add test case for cuda compiler setting fix
Signed-off-by: Matt Madison <matt@madison.systems>
2020-09-02 17:48:39 +02:00