Most apple system frameworks do not have a Versions directory in them at
all.
Fixes the following traceback:
...
File "/Users/matt/Projects/cerbero/build/build-tools/lib/python3.7/site-packages/meson-0.51.999-py3.7.egg/mesonbuild/interpreter.py", line 3063, in func_dependency
d = self.dependency_impl(name, display_name, kwargs)
File "/Users/matt/Projects/cerbero/build/build-tools/lib/python3.7/site-packages/meson-0.51.999-py3.7.egg/mesonbuild/interpreter.py", line 3110, in dependency_impl
dep = dependencies.find_external_dependency(name, self.environment, kwargs)
File "/Users/matt/Projects/cerbero/build/build-tools/lib/python3.7/site-packages/meson-0.51.999-py3.7.egg/mesonbuild/dependencies/base.py", line 2142, in find_external_dependency
d = c()
File "/Users/matt/Projects/cerbero/build/build-tools/lib/python3.7/site-packages/meson-0.51.999-py3.7.egg/mesonbuild/dependencies/base.py", line 2004, in __init__
self.detect(name, paths)
File "/Users/matt/Projects/cerbero/build/build-tools/lib/python3.7/site-packages/meson-0.51.999-py3.7.egg/mesonbuild/dependencies/base.py", line 2035, in detect
incdir = self._get_framework_include_path(framework_path)
File "/Users/matt/Projects/cerbero/build/build-tools/lib/python3.7/site-packages/meson-0.51.999-py3.7.egg/mesonbuild/dependencies/base.py", line 2065, in _get_framework_include_path
self._get_framework_latest_version(path))
File "/Users/matt/Projects/cerbero/build/build-tools/lib/python3.7/site-packages/meson-0.51.999-py3.7.egg/mesonbuild/dependencies/base.py", line 2057, in _get_framework_latest_version
return 'Versions/{}/Headers'.format(sorted(versions)[-1]._s)
IndexError: list index out of range
There are two variables that CMake takes into account during
find_package() in cross-compiled environments, which are: CMAKE_SYSROOT
and CMAKE_FIND_ROOT_PATH. Those are used in cmFindCommon::RerootPaths()
function, which blindly prepends all search paths with those specified
via CMAKE_SYSROOT and CMAKE_FIND_ROOT_PATH.
Extend search paths by using CMAKE_SYSROOT and CMAKE_FIND_ROOT_PATH in a
similar way as CMake does, so we successfully find CMake packages
information in cross-compiled environments.
In some cases it may be necessary to set PKG_CONFIG_SYSROOT_DIR, like
when you've mounted a host architecture system in an arbitrary path.
Meson will now check the cross files for a [properties]:sys_root
variable and set the PKG_CONFIG_SYSROOT_DIR environment variable based
on that variable.
Fixes#3801Fixes#4057
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.
As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
this is better, but it's still not perfect. cmake doesn't return quotes
to us in the trace output, and being 100% the same as cmake is pretty
much impossible without that information. What I've done should be a
"good enough" implementation without having to maintain a copy of every
property allowed in cmake, as well as custom properties.
Meson itself *almost* only cares about the build and host platforms. The
exception is it takes a `target_machine` in the cross file and exposes
it to the user; but it doesn't do anything else with it. It's therefore
overkill to put target in `PerMachine` and `MachineChoice`. Instead, we
make a `PerThreeMachine` only for the machine infos.
Additionally fix a few other things that were bugging me in the process:
- Get rid of `MachineInfos` class. Since `envconfig.py` was created, it
has no methods that couldn't just got on `PerMachine`
- Make `default_missing` and `miss_defaulting` work functionally. That
means we can just locally bind rather than bind as class vars the
"unfrozen" configuration. This helps prevent bugs where one forgets
to freeze a configuration.
When we create a dependency as part of another dependency (say Threads),
we want to pass down most of the methods (like required). Currently
however, there is the possibility that we can pass down invalid keyword
arguments, such as 'method'. This new method is meant to work around
that my simplifying and centralizing how we pass these dependencies
down.
Some things, like `method[...](...)` or `x: ... = ...` python 3.5
doesn't support, so I made a comment instead with the intention that it
can someday be made into a real annotation.
Instad of having special casing of threads in the backends and
everywehre else, do what we did for openmp, create a real
dependency. Then make use of the fact that dependencies can now have
sub dependencies to add threads.
I'll be using this later, but it seems useful to allow dependencies to
that have special handlers to declare that they depend on other
dependencies. This should allow us to stop treating threads special
internally and just make it a normal dependency.
This creates a new command line option to store pkg_config_path into,
and store the environment variable into that option. Currently this
works like the environment variable, for both cross and native targets.
Currently InternalDependency.get_partial_dependency shadows the the
input variables names, and then passes those new copies to the final
object returned. It also passes them to the arguments of of
get_partial_dependency for each subdependency, which is wrong. The
code is supposed to proxy the original argumetn values to that instead
of the shadowing values.
To avoid that this patch renames the new values.
It was a mistake in retrospect to not make this deprecated in the
first place, so let's do that. When cross files were new we needed
this as a way to specify a llvm-config binary, since it could be
passed via PATH overrides.