find_program() can check that for us already, there's no need to
require GNU bash on systems that default to other POSIX shells.
Even though this is the *linuxlike* tests and a POSIX shell is
guaranteed, there is actually no need to require a shell at all. It's
*easier* to use the meson builtin functionality here.
CMakes `target_link_libraries()` supports certain keywords to
only enable specific libraries for specific CMake configurations.
We now try our best to replicate this for Meson dependencies.
Fixes#9197
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.
D lang compilers have an option -release (or similar) which turns off
asserts, contracts, and other runtime type checking. This patch wires
that up to the b_ndebug flag.
Fixes#7082
cmake: get language from Meson project if not specified as depedency(..., langugage: ...)
deps: add threads method:cmake
dependency('threads', method: 'cmake') is useful for cmake unit tests
or those who just want to find threads using cmake.
cmake: project(... Fortran) generally also requires C language
Fortran: check for undeclared variables by forcing implicit none everywhere
C/C++: check for unused parameters and return types
removed unused variables from test cases
ci: do missing return and unused arg check with Github Actions
The test used by the new define_variable parameter was using the
includedir directory. However, in order to get a successful test,
the includedir variables needs to be relative to the prefix
variable, otherwise the replacemente will not have any effect.
This changes uses the prefix variable itself because we can
assure that it will be present.
pkg-config enables to define variables by using the define-variable
option. This allows some packages to redefine relative paths, so
files can be installed in the same relative paths but under prefix.
All our cached_dep magic was totally useless since we ended up using
the same identifier for native and cross deps. Just nuke all this
cached_dep code since it is very error-prone and improve the
identifier generation instead.
For instance, this is broken *right now* with the `type_name` kwarg.
Add a bunch of tests to ensure that all this actually works...
Closes https://github.com/mesonbuild/meson/issues/1736
Just checking that the version retrieved from the pkg-config file
matches is not enough. It's nearly tautological since it just checks
that we aren't returning garbage in dep.version(). Instead, check in the
test executable that the pkg-config version retrieved matches the
ZLIB_VERSION exported by zlib.
Also don't require zlib 1.2.8 since RHEL (EPEL) 7 still has 1.2.7 and we
don't really need 1.2.8 anyway.