Age | Commit message (Collapse) | Author | Files | Lines |
|
Fix the following Python error:
D:\a\1\s\run_unittests.py:6654: DeprecationWarning: invalid escape sequence \
self.assertEqual(libhello_nolib.get_pkgconfig_variable(escaped_var, {}), hello world)
Use a raw string literal.
|
|
Add a method to downgrade an option to disabled if it is not used.
This is useful to avoid unnecessary search for dependencies;
for example
dep = dependency('dep', required: get_option('feature').disable_auto_if(not foo))
can be used instead of the more verbose and complex
if get_option('feature').auto() and not foo then
dep = dependency('', required: false)
else
dep = dependency('dep', required: get_option('feature'))
endif
or to avoid unnecessary dependency searches:
dep1 = dependency('dep1', required: get_option('foo'))
# dep2 is only used together with dep1
dep2 = dependency('dep2', required: get_option('foo').disable_auto_if(not dep1.found()))
```
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Add a method to perform a logical AND on a feature object. The method
also takes care of raising an error if 'enabled' is ANDed with false.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This will allow adding "forced-off" Feature objects in the next patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This method simplifies the conversion of Feature objects to booleans.
Often, one has to use the "not" operator in order to treat "auto"
and "enabled" the same way.
"allowed()" also works well in conjunction with the require method that
is introduced in the next patch. For example,
if get_option('foo').require(host_machine.system() == 'windows').allowed() then
src += ['foo.c']
config.set10('HAVE_FOO', 1)
endif
can be used instead of
if host_machine.system() != 'windows'
if get_option('foo').enabled()
error('...')
endif
endif
if not get_option('foo').disabled() then
src += ['foo.c']
config.set10('HAVE_FOO', 1)
endif
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
This is problematic when we meson is installed in the different
root(say C:) while building from another root(say D:).
This is how it is done in mesonpep517 and causes problems
because of that.
|
|
|
|
When meson has setup the VS environment, running ninja to build won't
work, user should use meson wrapper to compile.
|
|
|
|
|
|
|
|
This fix calling random internal methods from meson.build as long as
they were not prefixed by underscore.
|
|
It is only needed in functions that need to add targets to the
interpreter.
|
|
Custom objects returned by modules must be subclass of ModuleObject and
have the state argument in its methods.
Add MutableModuleObject base class for objects that needs to be deep
copied on assignation.
|
|
The only advantage they have is they have the interpreter in arguments,
but it's already available as self.interpreter. We should discourage
usage of the interpreter API and rely on ModuleState object instead in
the future.
This also lift the restriction that a module method cannot add build
targets, but that was not enforced for snippet methods anyway (and some
modules were doing it) and it's really loose restriction as it should
check for many other things if we wanted to make it consistent.
|
|
|
|
Got the Idea from setuptools
https://github.com/pypa/setuptools/blob/a5131f0b82e098da6c07a03a47f36f3a52f73fb6/setuptools/msvc.py#L176
|
|
It was previously an hard error, only permitted since 0.59.0.
|
|
|
|
configuration
|
|
|
|
|
|
This way if we're doing a host == build configuration then the build and
host dependencies will be stored correctly.
|
|
|
|
Otherwise it'll except when it tries to get an attribute from None that
doesn't exist.
|
|
|
|
|
|
We need to pass any generated sources down the CustomTarget
inititalizers so that they will generate a dependency correctly,
otherwise we get race conditions.
|
|
The pre-2015 Visual Studio IDE do not handle things correctly for this test,
so disable this.
|
|
This will test the "whole archive" and "generator link whole" for all
Visual C++ versions.
|
|
...Update 2, to be exact, since the Visual Studio linker only gained the
`/WHOLEARCHIVE:` feature since Visual Studio 2015 Update 2.
This checks whether we have the corresponding `cl.exe` which is
versioned at or after Visual Studio 2015 Update 2 before we try to apply
the `/WHOLEARCHIVE:xxx` linker flag. If we aren't, use built-in methods
in Meson to grab the object files of the dependent static lib's, along
with the objects that were `link_whole:`'ed into them, and feed this
list into the linker instead.
This would make `link_whole:` work on Visual Studio 2015 Update 1 and
earlier, including previous Visual Studio versions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rework Xcode project navigation tree
|
|
Re-enable various tests on Cygwin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This partially reverts commit add502c6483bde9dc6a0ba80b3c79163304465a4.
In 'linkshared' test, annotate cppfunc() as imported, so an indirection
through an import stub is generated, avoiding a relocation size error
when building using gcc for Cygwin with LTO on.
Align with the example of how to write this portably in [1].
The 'c' language part of that test already gets this right.
[1] http://gcc.gnu.org/wiki/Visibility
|