Commit Graph

952 Commits

Author SHA1 Message Date
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
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Eli Schwartz a9f054e269 add warning for projects with manually specified -Werror
Point people to the "werror" builtin option.
2020-11-17 17:44:43 +02:00
Eli Schwartz aeb995fdc6 Do not warn when -Wpedantic is added as a project argument.
The only way to add it via warning_level is top opt in to -Wextra too.
But this is often not really desirable, since -Wextra is not stable --
it changes its meaning every compiler release, thus mysteriously adding
new warnings. Furthermore, it's not really the same kind of warning -- a
pedantic warning is always correct that your code is wrong, but defines
wrongness as "not per the portable standard". Unlike -Wextra it doesn't
try to judge your code to see if you're doing something that is "often
not what you meant", but is prone to false positives.

Really, we need different *kinds* of warning levels, possibly as an
array -- not just a monotonically increasing number. But since there's
currently nothing flexible enough to specify -Wpedantic without -Wextra,
we will just remove the warning for the former, and let people add it to
their project arguments in peace.
2020-11-13 17:45:40 +02:00
Jussi Pakkanen d4cd0ceb9d The version kwarg must be a string. Closes #7975. 2020-11-13 06:17:13 -05:00
Jones 8351e85bbd
interpreter: Add get_keys function for configuration_data (#7887) 2020-11-12 20:43:17 +02:00
Dylan Baker 47d071a34f interpreter: store correct files for project regeneration
Right now sub-sub projects are not correctly registered, because we
don't have a way to pass up past the first level of subproject. This
patch changes that by making the build_Def_files as defined in the
Interpreter initializer accurate for translated dependencies, ie, cmake
dependencies won't define a dependency on a non-existent meson.build.
This means that it can always add the subi.build_def_files because they
are always accurate.
2020-11-01 19:26:31 +02:00
Dylan Baker bf5bcad05f interpreter: Add missing new feature flag for executable(win_subsystem)
I noticed this when reviewing #7872
2020-10-19 13:48:56 -04:00
Paolo Bonzini df29f760dd switch gui_app deprecation to FeatureDeprecatedKwargs
The deprecation message for "gui_app" is appearing for every target
rather than just once, and even if the required version is older
than 0.56.0.  Use @FeatureDeprecatedKwargs to fix both issues.
2020-10-19 09:40:31 -07: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
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 173c115834 Add wrap mode to disable auto promote 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 e00df9046d include_type: honor include_type in dependency fallbacks (fixes #7503) 2020-10-13 23:51:25 +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
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
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Daniel Mensinger 77b5c82d07 cmake: switch to pathlib (fixes #7322) 2020-10-04 10:45:48 +02: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
Xavier Claessens 7176b74fd6 Add meson.project_build/source_root() methods 2020-09-28 11:22:38 -04: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
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 19696c3dcd Allow installing dir from build dir 2020-09-13 13:54:47 -04:00
Jon Turney 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
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
Daniel Mensinger 23818fc5a3
typing: more fixes 2020-09-08 20:15:58 +02:00
Xavier Claessens 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
Xavier Claessens 6ca423e1fc interpreter: Do not get variable on failed subproject
Fixes: #7620
2020-08-20 18:47:33 -04:00
Eli Schwartz 86b47250c6 simplify shutil usage by invoking copy2 where appropriate
It's equivalent to copyfile + copystat with the same arguments.
2020-08-20 23:47:54 +03: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
Nirbheek Chauhan 23f795fb54 find_library: Print type of library not found
If we can't find a static library, we should say that. It's confusing
otherwise.
2020-08-15 10:29:07 +00:00
Xavier Claessens 435db35962 interpreter: Don't force fallback when subproject failed to configure
Fixes: #7534
2020-08-12 13:38:55 +00:00
Xavier Claessens 2e4a2bb373 interpreter: Lower case languages before checking if 'c' is in the list
Fixes: #7495
2020-08-07 23:44:31 +03:00
John Ericson 2447a1132a Capitalize some constants in coredata
I've been getting confused between them and similarly-named other
things, so I figured it was high time to clean this up.
2020-08-04 00:24:05 +03:00
Dylan Baker 591e6e94b9 Put machine file and cmd line parsing in Environment
This creates a full set of option in environment that mirror those in
coredata, this mirroring of the coredata structure is convenient because
lookups int env (such as when initializing compilers) becomes a straight
dict lookup, with no list iteration. It also means that all of the
command line and machine files are read and stored in the correct order
before they're ever accessed, simplifying the logic of using them.
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
Zbigniew Jędrzejewski-Szmek 3dea817a59 Only emit warning about "native:" on projects with minimum required version
'native:' keyword was only added in 0.54. For projects declaring
meson_version >= 0.54, warn, because those projects can and should set
the keyword. For older projects declaring support for older versions,
don't warn and use the default implicitly.

Fixes https://github.com/mesonbuild/meson/issues/6849.
2020-07-28 19:51:58 +02:00
Xavier Claessens 7f1e9b7492 summary: Wrap lines when printing lists
When a list_sep is provided (e.g. ', ') all items are printed on the
same line, which gets ugly on very long lists (e.g. list of plugins
enabled).
2020-07-21 07:30:37 +00:00
Marc-André Lureau 1c945511eb Print a warning when importing a stabilized module 2020-07-19 17:53:32 +03:00
Xavier Claessens b510d644fe find_program: Do not use fallback when before parsing project()
Mesa is doing `project(... find_program() ...)` so
environment.wrap_resolver is not defined yet.
2020-07-04 13:57:51 +03:00
Xavier Claessens f66c8c35da qt: Fix has_tools() when required=False
Improve logs by making it clear when the program is found but has
wrong version.
2020-07-04 13:57:08 +03:00
Alexander Neumann 92075f5ef3 give user control of option skip_sanity_check 2020-07-04 13:31:25 +03:00
Xavier Claessens 7c90639078 interpreter: Don't abort if dep isn't required and sub didn't override 2020-07-01 09:51:57 -04:00
Xavier Claessens f7a07ee91a interpreter: Already configured fallback should be used for optional dep 2020-07-01 09:51:57 -04:00
Xavier Claessens 13316f99fe wrap: Refactor to split wraps dictionary into 3 separate dicts
It makes the code cleaner to have 3 separate dictionaries for
packagename, dependency and programs.
2020-07-01 09:51:57 -04:00
Xavier Claessens f08eed37cb find_program: Fallback if a wrap file provide the program name
We don't need the legacy variable name system as for dependency()
fallbacks because meson.override_find_program() is largely used already,
so we can just rely on it.
2020-07-01 09:51:57 -04:00
Xavier Claessens 288d1ae5a5 wrap: Do not fallback implicitly on optional dependency
This fix the following common pattern, we don't want to implicitly
fallback on the first line:

foo_dep = dependency('foo', required: false)
if not foo_dep.found()
  foo_dep = cc.find_library('foo', required : false)
  if not foo_dep.found()
    foo_dep = dependency('foo', fallback: 'foo')
  endif
endif
2020-07-01 09:51:57 -04:00
Xavier Claessens 2a7f72885f wrap: Add 'provide' section 2020-07-01 09:51:44 -04:00
Xavier Claessens 56c9e95b04 Implicit dependency fallback when a subproject wrap or dir exists 2020-07-01 09:45:33 -04:00
Jussi Pakkanen 64f36613ef
Merge pull request #7231 from mensinda/cmOverride
cmake: Add more advanced subproject configuration options
2020-07-01 00:04:08 +03:00
Xavier Claessens 07d2331d23 interpreter: Allow dependecy or subproject name in force_fallback_for 2020-06-16 17:36:33 -04:00
Xavier Claessens 4180f04433 interpreter: Avoid new feature warning when using old has_exe_wrapper() 2020-06-16 15:04:03 -04:00
Mathieu Duponchelle 20709af4d2 interpreter: add support for --force-fallback-for
This new command line option allows specifying dependencies for
which to force fallback.

See the documentation for more information

Fixes: #7218
2020-06-16 13:45:40 -04:00
D Scott Phillips f6a842821b Fix python3 installed from the Windows Store
When meson is currently being run with a python that seems to have been
installed from the Windows Store, replace the general WindowsApps
directory in search paths with dirname(sys.executable), and also handle
failures with pathlib.resolve on WindowsApps exe files.
2020-06-10 01:09:16 +03:00
Daniel Mensinger a2f94ca18b
cmake: Add more advanced subproject configuration options
This is done with the new cmake subprojects options object
that is similar to the already exisiting configuration data
object. It is consumed by the new `options` kwarg of the
cmake.subproject function.
2020-06-05 11:45:05 +02:00
Jussi Pakkanen c61f75adbf
Merge pull request #6818 from mensinda/localPatch
Wrap: add local files support via *_filename
2020-05-27 23:42:30 +03:00
Dylan Baker e35584e9ff interpreter: Add always set default value for version and set it ASAP
Ideally we wouldn't need to have the default dict here and could just
rely on it being set as soon as project is called. There is a corner
case exercised by test case common/35 run program, which is that if a
FeatureNew or FeatureDeprecated is called to generate the meson version
it will be unset, to work around this I've changed the type from a dict
to a default dict with '' as the default value.

A better fix would probably be to store all of the
FeatureNew/FeatureDeprecated checks until the end, then evaluate them,
but for now this results in no loss of functionality, only more
functionality, even if it isn't prefect.
2020-05-14 12:15:03 -07:00
Dylan Baker d51551231f use FeatureNew.single_use
This is just slightly cleaner looking
2020-05-14 12:15:03 -07:00
Dylan Baker 06481666f4 interpreter: Replace some uses of mlog.deprecation with FeatureDeprecated
This gives the version that the feature was deprecated in, and doesn't
print the warning if the project supports versions of meson in which the
project wasn't deprecated.
2020-05-14 11:28:04 -07:00
Dylan Baker a63e36f7b1 interpreter: Rename has_exe_wrapper -> can_run_host_binaries
The implementation of this function has changed enough that the name
doesn't really reflect what it actually does. It basically returns true
unless you're cross compiling, need and exe_wrapper, and don't have one.

The original function remains but is marked as deprecated.

This makes one small change the meson source language, which is that it
defines that can_run_host_binaries will return true in build == host
compilation, which was the behavior that already existed. Previously
this was undefined in build == host compilation.
2020-05-14 11:04:51 -07:00
Dylan Baker 85708facae
Merge pull request #6620 from jon-turney/test-output-check
Add a mechanism for validating meson output in tests
2020-05-13 11:32:28 -07:00
Jussi Pakkanen 4ea7c6ee12
Merge pull request #7064 from dcbaker/gtest-protocol
Add support for Gtest as a test protocol
2020-05-06 23:57:44 +03:00
Dylan Baker 083c5f6357 Add native support for gtest tests
Gtest can output junit results with a command line switch. We can parse
this to get more detailed results than the returncode, and put those in
our own Junit output. We basically just throw away the top level
'testsuites' object, then fixup the names of the tests, and shove that
into our junit.
2020-05-04 11:33:19 -07:00
Jussi Pakkanen 9a6e79dc68
Merge pull request #7060 from dcbaker/install-script-targets
Allow meson.add_*_script to take additional types
2020-05-03 23:20:59 +03:00
Dylan Baker 28e3ce67ae Convert test protocol into an enum
This gives us better type safety, and will be important as we add more
test methods
2020-04-30 13:54:46 -07:00
James Hilliard d7c24ccddd Allow get_variable to still function when the fallback is a disabler. 2020-04-30 13:06:56 -07:00
Jon Turney b647ce1b63
Cosmetic tweak to error message for incdir() with an absolute path
Cosmetic tweak to the error message for incdir() with an absolute path.
Don't split the message in the middle of a sentence at a point which may
or may not correspond to the terminal width.
2020-04-30 20:11:34 +01:00
Jon Turney 1081738113
Check before compiler detection if 'c' language is present when adding 'vala'
For the sake of a consistent error message (irrespective of if 'valac' is
present or not), check if the 'c' language is present if we are adding
'vala' before (rather than after) we do compiler detection.
2020-04-30 20:11:33 +01:00
Jon Turney 6a5c6fb439
Be more careful about the use of repr() in error messages
Generally, we'd want to use str() rather than repr() in error messages
anyhow, as that explicitly gives something designed to be read by
humans.

Sometimes {!r} is being used as a shortcut to avoid writing the quotes
in '{!s}'.

Unfortunately, these things aren't quite the same, as the repr of a
string containing '\' (the path separator on Windows) will have those
escaped.

We don't have a good string representation to use for the arbitrary
internal object used as an argument for install_data() when it's neither
a string nor file (which doesn't lead to a good error message), so drop
that for the moment.
2020-04-30 20:11:32 +01:00
Dylan Baker c239ce31f5 allow postconf and dist scripts to use Files, ExternalPrograms, and
ConfigureFiles

These things are all known to be ready when these scripts are run, and
thus they can safely consume them.
2020-04-30 10:01:14 -07:00
Dylan Baker 2c0eaf5c4f interpreter: Allow install_script to use additional input types
This adds support for Files, CustomTarget, Indexs of CustomTargets,
ConfigureFiles, ExternalPrograms, and Executables.

Fixes: #1234
Fixes: #3552
Fixes: #6175
2020-04-30 10:01:14 -07:00
Benjamin Frye ad426547e8
Clarified error message for test(). (#7040)
Changes the error message for test() so it now reports the expected and actual number of parameters.

Fixes: #7029
2020-04-28 21:28:20 -07:00
Xavier Claessens 707d3a2e20 gnome: Fix usage of gobject-introspection as subproject 2020-04-28 14:39:59 -04:00
Eli Schwartz 76c36a64c3
dependency: log cached or skipped dependencies with reference to modules
* dependency: log cached or skipped dependencies with reference to modules

If the dependency is a special dependency which takes modules, the
modules get cached separately and probably reference different
pkg-config files. It's very plausible that we have multiple
dependencies, using different modules. For example:

  Run-time dependency qt5 (modules: Core) found: YES 5.14.2 (pkg-config)
  Dependency qt5 skipped: feature gui disabled

Obviously this makes no sense, because of course we found qt5 and even
used it. The second line is a lot more readable if it shows this:

  Dependency qt5 (modules: Widgets) skipped: feature gui disabled

Similar confusion abounds in the case where a module is found in the
cache -- which module, exactly, has been found here:

  Dependency qt5 found: YES 5.14.2 (cached)

Rewrite the dependency function to *consistently* pass around (and use!)
the display_name even in cases where we know it isn't anonymous (this is
just more correct anyway), and make it serve a dual purpose by also
appending the list of modules just like we do for pretty-printing that a
dependency has just been found for the first time.

* fixup! dependency: log cached or skipped dependencies with reference to modules

pointlessly cast modules to str, as they cannot be anything else. But we
want to fail later on, with something more friendly than a stacktrace.
boost/wx have special exceptions for people passing an integer there.
2020-04-28 02:06:39 +03:00
Xavier Claessens 39a69d1fb0 find_program: Fixes when the program has been overridden by executable
- ExternalProgramHolder has path() method while CustomTargetHolder and
  BuildTargetHolder have full_path().
- The returned ExternalProgramHolder's path() method was broken, because
  build.Executable object has no get_path() method, it needs the
  backend.
- find_program('overridden_prog', version : '>=1.0') was broken because
  it needs to execute the exe that is not yet built. Now assume the
  program has the (sub)project version.
- If the version check fails, interpreter uses
  ExternalProgramHolder.get_name() for the error message but
  build.Executable does not implement get_name() method.
2020-04-28 01:39:56 +03:00
Daniel Mensinger ccdf7f6d34
wrap: Add support for local files via only `*_filename` 2020-04-25 11:43:42 +02:00
John Ericson 278c294aa4 Compiler options per lang
A current rather untyped storage of options is one of the things that
contributes to the options code being so complex. This takes a small
step in synching down by storing the compiler options in dicts per
language.

Future work might be replacing the langauge strings with an enum, and
defaultdict with a custom struct, just like `PerMachine` and
`MachineChoice`.
2020-04-20 23:23:15 +03:00
Xavier Claessens f798207a9a interpreter: Correctly ignore def files in build directory
See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/85.
2020-04-17 22:02:41 +00:00
Ariel D'Alessandro 55f02c1949 interpreter: find_program: Store program's name when not found
Currently, looking for a nonexisting program using find_program() will
return an NonExistingExternalProgram instace with the default name
'nonexistingprogram'. Let's store the target program's name in it, so it
can be printed if needed.

Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
2020-04-14 23:20:39 +03:00
Ariel D'Alessandro b1b3987d9c interpreter: Show program's name on run_command error message
Currently, the error message is printing the object itself. Showing the
program's name is better.

Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
2020-04-14 23:20:39 +03:00
Xavier Claessens 1ba62c484d Fix requireed meson version for override_dependency() 2020-04-08 23:45:00 +03:00
Michael Hirsch, Ph.D 5b4ebb5641 quality / test: Fortran type hinting
enhance fortran args tests
2020-04-05 13:43:53 +03:00
Daniel Mensinger 570adf0900
interpreter: Fix Disabler support for modules 2020-04-02 10:57:48 +02:00
John Ericson 3a4388e51d Fix legacy env var support with cross
Fix #3969
2020-03-23 17:51:36 +02:00
Jussi Pakkanen 9e5c881b06 Add property to disable compiler sanity checks during cross compilation. 2020-03-22 23:07:53 +02:00
Jussi Pakkanen 84e216fd64
Merge pull request #6636 from jon-turney/machine-detection-problems
Redetect machines when languages change
2020-03-20 20:35:59 +02:00
Daniel Mensinger 673ca982f1 cmake: Add find_package COMPONETS support 2020-03-19 22:52:03 +02:00
Jussi Pakkanen 5c51d4521a
Merge pull request #6532 from jon-turney/languages-native-kwarg
Add add_languages(native:)
2020-03-09 01:20:57 +02:00
Jussi Pakkanen 44ff3e6c7d
Merge pull request #6736 from dcbaker/mesonlib-type-annotations
Mesonlib type annotations
2020-03-08 14:49:23 +02:00
Xavier Claessens 823c83b269 dependency: Verify fallback variable consistency
This change made `5 dependency versions` unit test fail because now once
a subproject has been configured, the fallback variable is checked to be
consistent. So it has to use new subproject because 'somesub' was
already configured by previous tests.
2020-03-06 15:26:02 -05:00
Xavier Claessens 8edc6d655d Improve logged messages for overriden dependencies 2020-03-06 15:26:02 -05:00
Xavier Claessens 141401c11d Allow override_dependency() with a not-found dep 2020-03-06 15:26:02 -05:00
Xavier Claessens 943e9368f7 Simplify dependency() fallback
Now that subprojects can override the dependency name, there is no need
to provide a variable name for the fallback any more.
2020-03-06 15:26:02 -05:00
Xavier Claessens 2fdedc4d0f Add meson.override_dependency()
Similar to meson.override_find_program() but overrides the result of the
dependency() function.

Also ensure that dependency() always returns the same result when
looking for the same dependency, this fixes cases where parts of the
project could be using a system library and other parts use the library
provided by a subproject.
2020-03-06 15:25:46 -05:00
Dylan Baker 06b1a317d2 Make use of unholder
We have a lot of cases of code like:
```python
if hasattr(var, 'held_object'):
    var = var.held_object`
```

replace that with the unholder function.
2020-03-05 09:58:52 -08:00