Commit Graph

37 Commits

Author SHA1 Message Date
Nirbheek Chauhan d737488150 dependencies: Don't assume self.compiler is a C compiler
All dependencies were using find_library, has_header, get_define, etc on
self.compiler assuming that it's a compiler that outputs and consumes
C-like libraries. This is not true for D (and in the future, for Rust)
since although they can consume C libraries, they do not use the
C ecosystem.

For such purposes, we now have self.clib_compiler. Nothing uses
self.compiler anymore as a result, and it has been removed.
2018-06-20 11:27:08 +00:00
Jussi Pakkanen 8b9fe0efff No longer require duplicate gtest header install. 2018-05-04 11:46:22 +00:00
Dylan Baker 221c3ec105 llvm: Add configs for freebsd 6.0 and debian 7svn
Debian has 7svn in their experimental repo, and FreeBSD has 6.0.r2 in
their ports.
2018-02-22 22:24:07 +02:00
Dylan Baker d889989ea1 dependnecies: generalize version suffix stripping code
This replaces calls to .rstrip('git'), .rstrip('svn') with a regex that
takes the leading numbers and dots, and throws away the rest. This also
moves the code up to the ConfigToolDepdency level, since these config
tools are of various quality and some of them are good, and some are
not. This shouldn't affect well behaved tools.

This should future proof LLVM against future suffixes (like someone
doing something strange like using Mercurial as a VCS).
2018-01-18 11:07:41 -08:00
Dylan Baker a9210c57e1 LLVM: work around FreeBSD specific static linking problems
Because FreeBSD's llvm-config adds -l/usr/lib/libexecinfo.so when asked
for system-libs, which is bogus. We'll remove the leading -l from any
argument that also ends with .so.
2018-01-06 13:49:34 -08:00
Dylan Baker 660dee1e10 LLVM: use DragonFly BSD workaround on FreeBSD as well 2018-01-06 13:49:34 -08:00
Dylan Baker 448ba5b6f3 LLVM: work around bug in dragonfly bsd llvm-config for shared libs
Of course there are OS specific bugs for llvm-config as well, so work
around those too.
2018-01-06 13:49:34 -08:00
Dylan Baker 3a0f8ab0cf dependencies/dev: remove unused imports
flake8 complains about them, and I prefer to have a clean error log in
vim.
2018-01-06 13:49:34 -08:00
Dylan Baker 0bbc9df74a dependencies: Also strip git version from llvm version
If LLVM is built from a git mirror instead of from SVN it will have
"git-<very short sha>" at the end of the version. We need to remove that
so that version comparison will work correctly.

Fixes: #2786
2017-12-16 14:42:30 +02:00
Dylan Baker 11b62c3c51 dependencies: use mlog.bold with llvm module/component names. 2017-12-15 14:20:16 -08:00
Dylan Baker 2b2ee68f90 dependencies: Print LLVM for LLVM dependency
Instead of config-tool
2017-12-15 13:46:24 -08:00
Jussi Pakkanen 746e70c0da
Merge pull request #2512 from dcbaker/wip/config-tool-variables
Add method to get values from config tool based dependency
2017-11-28 22:01:00 +02:00
Josh Soref 47bacd40e0 spelling: attempt 2017-11-26 05:12:21 +00:00
Josh Soref 8a66cfb2af spelling: arbitrary 2017-11-26 05:08:02 +00:00
Dylan Baker f0248b0342 Make LLVMDependency a ConfigToolDependency 2017-11-23 19:54:47 -08:00
Nirbheek Chauhan 18b42c5370 llvm: Output stderr when generating libs/flags/etc fails
f.ex when you don't have the llvm-static package installed, the error
message when generating libs is cryptic and uninformative since we
discard stderr.
2017-11-13 21:02:43 +02:00
Dylan Baker a8d3eb3c10 llvm: llvm 5.0 is released and the current stable
So set it as the first versioned config to check for, and add
llvm-config-6.0 to the list of configs.
2017-11-09 21:08:44 +02:00
Dylan Baker 3aa97d4ab5 llvm: fix static vs dynamic linking
LLVM >= 3.9 provides an llvm-config that has a sane mechanism for
selecting static vs dynamic linking. LLVM < 3.9 (but >= 3.5) not so
much. For those older LLVM versions, llvm-config will always provide
arguments for statically linking LLVM, even if there is a library for
dynamic linking.

Fixes #2442
2017-10-25 10:07:50 -07:00
Dylan Baker 5584409346 llvm: Add support for linking statically
This adds support for the static kwarg to the llvm dependency.
2017-10-25 10:03:34 -07:00
Dylan Baker 6cbbbd546e llvm: Add modules to libs check
Which is required for statically linking with LLVM.
2017-10-25 10:03:34 -07:00
Dylan Baker 3e004ae611 llvm: check for components (modules) before libs.
For statically linking we need to pass the modules to llvm-config, so we
need to validate them and have them ready to use before then.
2017-10-25 10:03:34 -07:00
Dylan Baker cadf5f3c04 llvm: Add optional modules
These will become more relevant later in the series.
2017-10-25 10:03:34 -07:00
Dylan Baker 7841210b4f llvm: Add helper function for checking modules
This will be used in a later patch.
2017-10-25 10:03:34 -07:00
Dylan Baker 9262236322 llvm: strip system libraries from link arguments
v2: - use clang and gcc's -print-system-libs option as suggested by
      Daniel Stone.

Fixes #2437
2017-10-21 10:36:00 -07:00
Dylan Baker e8df59cc5f llvm: don't add --system-libs
On LLVM < 4.0 this adds linker arguments like -lm, which we don't want.

Related #2442, 2437
2017-10-07 18:00:57 +03:00
Nirbheek Chauhan bb0e18b738 Use listify and extract_as_list everywhere
They now flatten by default and unhold objects if required

Includes unit tests.
2017-10-01 22:27:48 +05:30
Dylan Baker 5a8d1b6431 deps: strip 'svn' from LLVM version 2017-09-26 17:12:49 -07:00
Dylan Baker 035bee5c54 deps: demote LLVM config to instance variable
Which fixes trying to use multiple versions of LLVM, and allows
simplifying the class somewhat.
2017-09-26 13:06:22 -07:00
Dylan Baker 95ba1fcab2 deps: convert LLVM modules to a set before checking for them
This allows the logic in a meson.build file to be simplified (ie, some
dependencies can add the same module requirements) but meson will only
check for them once. Since set is inherently unordered, use sorted to
make the output deterministic.
2017-09-26 13:06:22 -07:00
Dylan Baker ce6099b704 deps: flatten module argument to LLVM dependency
So that nested lists can be passed.
2017-09-26 13:06:16 -07:00
Nirbheek Chauhan ea3e28dbb9 valgrind: Fix __init__ call
Adds a test so that this is catched later.

Closes https://github.com/mesonbuild/meson/issues/1937
2017-06-17 12:33:06 +03:00
Nirbheek Chauhan 38716f0fcb tests: Improve llvm dependency test coverage 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
Ting-Wei Lan 139152b0ef Update the list of possible llvm-config binaries
This commit syncs the list with gnome-builder, which updates its list
in https://bugzilla.gnome.org/show_bug.cgi?id=782296.

llvm-config40 is added becaue LLVM 4.0 becomes a stable release.
llvm-config-5.0 is added to the bottom of the list because it is still
a development snapshot (svn trunk).
2017-06-07 19:54:45 +03:00
Lars Persson a3856be1d5 gmockdependency: find libraries using the compiler
Use the compiler object to find the gmock library. Fixes following
cases:
- cross compiling looked in host library paths
- static libgmock was not supported

Change-Id: Ie3912b8b4dd3b71d7a5ae2adae7295d3b685fddf
2017-05-14 19:01:14 +03: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 d96b16c24b Split development-related deps into their own file. 2017-05-09 18:13:10 -04:00