Commit Graph

13 Commits

Author SHA1 Message Date
Nirbheek Chauhan 73c06780f9 Make external library no-op when used with incompatible target (#1941)
* tests: Add a test for C library in Vala target

https://github.com/mesonbuild/meson/issues/1939

* Make external library no-op when used with incompatible target

This is how it used to behave earlier, but we accidentally regressed

Closes https://github.com/mesonbuild/meson/issues/1939
2017-06-17 12:34:26 +03:00
Nirbheek Chauhan 3a33a8ef49 unit tests: Add class to generate failing tests
It is not feasible to test all failure modes by creating projects in
`test cases/failing` that would be an explosion of files, and that
mechanism is too coarse anyway. We have no way to ensure that the
expected error is being raised.

See FailureTests.test_dependency for an example.
2017-06-09 20:21:01 +05:30
Nirbheek Chauhan ed6a5abee8 find_library: link_args is always a list 2017-06-09 20:21:01 +05:30
Nirbheek Chauhan c4d7667675 ExtraFrameworkDependency: Don't set required
Otherwise we will never hit the informative DependencyException.
2017-06-09 20:21:01 +05:30
Nirbheek Chauhan 0c83f8352d dependencies: Add a new class ExternalDependency
This class now consolidates a lot of the logic that each external
dependency was duplicating in its class definition.

All external dependencies now set:

* self.version
* self.compile_args and self.link_args
* self.is_found (if found)
* self.sources
* etc

And the abstract ExternalDependency class defines the methods that
will fetch those properties. Some classes still override that for
various reasons, but those should also be migrated to properties as
far as possible.

Next step is to consolidate and standardize the way in which we call
'configuration binaries' such as sdl2-config, llvm-config, pkg-config,
etc. Currently each class has to duplicate code involved with that
even though the format is very similar.

Currently only pkg-config supports multiple version requirements, and
some classes don't even properly check the version requirement. That
will also become easier now.
2017-06-09 20:21:01 +05:30
Elliott Sales de Andrade 07bad04a86 Handle required `ExtraFrameworkDependency`s. 2017-05-17 19:43:23 -04:00
Lars Persson a1a4f66e6d gtestdependency: find libraries using the compiler
Use the compiler object to find gtest libraries. Fixes following
cases:
- cross compiling looked in host library paths
- static libgtest was not supported

Change-Id: If42cdf873db38676b99adca60752f652aff097a2
2017-05-14 19:01:14 +03:00
Elliott Sales de Andrade 8731e00ada Tweak formatting of base dependency file. 2017-05-09 18:28:05 -04:00
Elliott Sales de Andrade d3caadb675 Split misc dependencies into their own file. 2017-05-09 18:28:05 -04:00
Elliott Sales de Andrade cb24c2d58a Split apart platform-specific dependencies 2017-05-09 18:28:04 -04:00
Elliott Sales de Andrade d96b16c24b Split development-related deps into their own file. 2017-05-09 18:13:10 -04:00
Elliott Sales de Andrade 23f9b42d3b Split UI-related into a separate file.
Some of these are a bit bigger than just UI libraries, but this division
seems close enough.
2017-05-09 18:13:09 -04:00
Elliott Sales de Andrade 92557e1c2a Move dependencies.py into a subdirectory. 2017-05-09 17:39:38 -04:00