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.
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
The value for that key must be a coma separated list of dependecy names
provided by that subproject, when no variable name is needed because the
subproject uses override_dependency().
Machine files already supports `+` operator as an implementation detail,
since it's using eval(). Now make it an officially supported feature and
add a way to define constants that are used while evaluating an entry
value.
This lets servers know when they're being used by meson. It also avoids
issues where the Independent JPEG Group decided to ban the
"Python-urllib" default user agent.
Fixes https://github.com/mesonbuild/libjpeg/issues/9
Since the CompileArgs class already needs to know about the compiler,
and we really need at least per-lanaguage if not per-compiler
CompilerArgs classes, let's get the CompilerArgs instance from the
compiler using a method.
When changing meson option cpp_eh, it was passed to cl with AdditionalOptions and resulted in unsuppressable warning "cl : command line warning D9025: overriding '/EHs' with '/EHa'"
- vcpkg libraries are not found when given cmake_toolchain_file and vcpkg_target_triplet as cmake_args when looking for the dependency if the first call to cmake has different arguments. The libraries are found if the first call has same arguments or if the CMakeCache.txt is deleted in call_with_fake_build.
This is needed in the case where a custom_target directly depends on a
shared library, and somehow loads it.
(Specifically this can be the case with gtkdoc, when it invokes
gtkdoc-scangobj, which will build and run it's own code to load a shared
library, to introspect it)
Handle command arguments which contain multiple substitutions correctly
in Backend.eval_custom_target_command()
In particular, gnome.gtkdoc() makes arguments of the form '--cflags
-I@SOURCE_ROOT@ -I@BUILD_ROOT' (where these arguments are then passed
down to a compiler invocation)
Normally, these are subsequently made right by
NinjaBackend.replace_paths(), but if Backend.as_meson_exe_cmdline()
decides that the command needs to be pickled, that doesn't happen.
(Although having two places where this substitution might happen smells
really bad)
Since we parse buildoptions.json to pass options, we end up passing
-Dbuildtype and also -Doptimization and -Ddebug which triggers the
warning:
WARNING: Recommend using either -Dbuildtype or -Doptimization + -Ddebug [...]
Filter out buildtype. It is redundant.
Otherwise we can end up finding dependencies from the build machine for
the host machine, which is incorrect. This alters cmake, pkg-config, and
all config-tool based dependencies.
Fixes: #7276