Commit Graph

146 Commits

Author SHA1 Message Date
Benjamin Redelings 71d24094cd Factor out code to compute modname from basename into a single place. 2018-01-01 22:42:49 -08:00
Jussi Pakkanen dd3f49af0d
Merge pull request #2757 from xclaesse/pkgconfig
pkgconfig: Allow passing Dependency objects to library(_private)
2017-12-31 19:11:57 +02:00
Niklas Claesson d014087fd9 boost: Allow older behavior with a warning
Fixes #2813
2017-12-25 13:52:36 +01:00
Xavier Claessens 1c0570906c pkgconfig: Allow passing Dependency objects to library(_private)
Special case ThreadDependency by taking compiler's flags and
PkgConfigDependency by adding them in requires(.private) instead. For
other Dependency objects just take their link_args and compile_args.

Closes #2725
2017-12-20 19:09:08 -05:00
Alexis Jeandet 0560478f75 [Dependencies] Add --ldflags to cups-config invocation
--libs only gives libs to link with, not flags and eventually lib path

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-12-20 20:35:51 +02:00
Jussi Pakkanen 5ff9e05c8b
Merge pull request #2697 from mesonbuild/custom-target-depends-serialize
custom target: Consider all build depends while serializing
2017-12-10 14:23:31 +02:00
Nirbheek Chauhan 533e666901 dependencies: Fix detection of link args on MSYS2
The sysconfig config variables are different on MSYS2 and the paths
are also different. We now also use the full path to the import or
static library instead of using -Lfoo -lpython35 etc.

Also obey the value of the 'static' keyword argument.
2017-12-10 01:29:35 +05:30
Nirbheek Chauhan 6f42f83867 dependencies: Fix detection of Python arch on MSYS
sysconfig.get_platform() returns 'mingw' with MSYS2, so we need to
use some other method; in this case I chose to use the CC that
Python was compiled with, which is a relatively reliably indicator
unless people start using Python on Windows compiled with Clang or
something.
2017-12-10 01:29:33 +05:30
Niklas Claesson 9884508535 Boost: Pick correct version
If many binary packages are installed, pick the one built with the correct
toolset. Fixes #2532
2017-12-03 23:21:33 +02:00
Jussi Pakkanen 018deb48fe
Merge pull request #2663 from inigomartinez/pkg-config-define-variable
dependencies: Allow pkg-config to define variables
2017-12-03 22:53:44 +02:00
Nirbheek Chauhan 133df3b045 dependencies: Pass language to PkgConfigDependency
Also try harder to find a compiler that dependencies can use.

This means that in C++-only projects we will use the C++ compiler for
compiler checks, which can be important.
2017-12-03 10:06:11 +05:30
Jussi Pakkanen cabbb30ab4
Merge pull request #2668 from dcbaker/wip/macos-10.13-fixes
macos 10.13 fixes
2017-11-30 22:18:25 +02:00
Dylan Baker df3c006456 Use ConfigToolDependency for libwmf 2017-11-23 19:54:48 -08:00
Dylan Baker 11fbc982d3 Use ConfigToolDependency for pcap 2017-11-23 19:54:48 -08:00
Dylan Baker a2f3182172 Use ConfigToolDependency for cups 2017-11-23 19:54:48 -08:00
Dylan Baker 203c5ce990 dependencies: Don't like for python 3 in /System on macOS
That python will always be python2
2017-11-21 15:08:46 -08:00
Iñigo Martínez 935ca12822 dependencies: Allow pkg-config to define variables
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.
2017-11-20 22:00:25 +01:00
Anonymous Maarten 5cfb378442 Enable get_pkgconfig_variable for python3 dependencies
fixes mesonbuild/meson#2508
2017-11-13 23:08:01 +01:00
Jan Niklas Hasse 46736fc16c Use mlog.warning for invalid boost module
Instead of mlog.debug. This make the warning visible to the user.
2017-11-13 21:07:00 +02:00
Jan Niklas Hasse c3d143298b Log instead of raise if Boost module invalid
BOOST_LIBS could become outdated in future versions, which would result
in dependency('boost', modules : [ 'foo' ], required : false) to fail,
although required was set to false. Therefore turn the exception into
log_fail(). If required was set to true, this will still be caught since
is_found remains False.

This also improves logging by printing all invalid module names instead
of only the first one.
2017-11-13 21:07:00 +02:00
Félix Piédallu bb84c1d109 Add LibWmf as a specified dependency, and associated tests. 2017-10-31 01:05:46 +02:00
Goncalo Carvalho 01611a66e2 Fix boost link cmd line when compiler.find_library returns None, self.request_modules doesn't have 'boost_' prefix but lib_modules is keyed on 'boost_*' 2017-10-29 02:13:54 +03:00
Niklas Claesson 14e7b0af25 Boost: Add Python libraries
Fixes: #2507
2017-10-25 21:08:54 +03:00
Niklas Claesson c97e7749a6 Boost: Jamfile has two syntaxes for boost libraries
Fixes #2456
2017-10-12 21:45:23 +03:00
Jan Niklas Hasse 7b36897ff9 Use get_default_include_dirs to detect BOOST_ROOT
This removes the need to specify BOOST_ROOT for cross-compilers.
2017-10-07 18:02:08 +03:00
Niklas Claesson bbdba876af Boost: Improve search algorithm
The new implementation will correctly pick boost from 3 possible
locations on windows and two locations on posix compatible OSs.

The new search algorithm also differentiates between debug and
release builds of Boost and multi or single threading builds.

It was also decided to map "Meson modules" to Boost software libraries
and not Boost modules since it there are a lot of options regarding
linking. Some modules can even be used either as headers-only or with
dynamic linking.

This commit also fixes a bug that prevented header-only use on Windows.

Fixes: #2274 #2239 #1803 #669
2017-10-01 18:49:27 +02:00
Niklas Claesson 09ccd0eeaa C/C++: Get default include dirs from compilers 2017-10-01 18:35:33 +02:00
Jussi Pakkanen bea6b1a6f6 Merge pull request #2187 from centricular/fix-pcap-dependency
Fix pcap dependency, str.strip() now takes an argument, add cc.get_return_value()
2017-09-22 22:04:18 +03:00
Nirbheek Chauhan 177283d203 pcap dependency: Frameworks for libpcap do not exist
The only ways to get it are via Homebrew or Macports, which install
pkg-config files and/or pcap-config
2017-09-22 19:11:57 +05:30
Nirbheek Chauhan 20991c0669 dependencies: Add version detection to pcap 2017-09-20 13:36:42 +05:30
Alexis Jeandet e553d0807b Last round with listify function refactoring.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-09-18 22:25:34 +02:00
Iñigo Martínez 35ef236c43 add support for cups dependencies (#2255)
* add support for cups dependencies

libcups has its own cups-config tool rather than using pkg-config.
This adds support for cups-config, based on pcap-config and
sdl2-config implementations.

This change also includes the unit test case and documentation for
cups dependency object implementation, and libcups2 dep to CI image.
2017-08-31 21:38:15 +03:00
Michał Wikliński 9154a6473b Find Boost dep when there is an extra lib to link
There are several components in Boost which must be linked with extra
libraries. Boost Log is one of them and in special circumstances needs
linking with boost_log_setup.

http://www.boost.org/doc/libs/1_64_0/libs/log/doc/html/log/detailed/utilities.html#log.detailed.utilities.setup

This fix covers the case when there is no source file corresponding to
the additional library.
2017-08-20 23:17:12 +03:00
Bruce Richardson c89b8c5c4b add support for pcap dependencies
Libpcap has its own pcap-config tool rather than using pkg-config. Add
support for pcap-config, based on the existing implementation of
sdl2-config that is there already.
2017-08-10 10:37:07 +01:00
Elliott Sales de Andrade 4cbfb9a08d Add support for MS-MPI. 2017-08-04 20:07:08 -04:00
Elliott Sales de Andrade 271601124e Filter out extra args from MPI wrappers. 2017-08-04 20:07:08 -04:00
Elliott Sales de Andrade 5a7e06a64f Add MPI dependency.
We prefer pkg-config files, though only OpenMPI supplies them.
Otherwise, check environment variables and search for wrappers and ask
them for what to do.
2017-08-04 20:06:47 -04:00
Wade Berrier ad1b487285 dependency: boost: only consult environment at initial stage
... not when getting compiler and link arguments

Would be nice to have some tests, but that requires boost in a
non-standard location.
2017-06-27 11:33:10 -04:00
Nirbheek Chauhan 9308a6d923 tests: Add Boost unit tests and project tests on Windows
Boost tests are disabled on Windows for now because the detection
is actually completely broken. Once that's fixed (after the release)
we can enable it again.
2017-06-10 18:55:50 +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
Adam C. Foltzer a53e44ad63 generalize the system include detection a bit
This should help when using a non-standard sysroot, common in cross-compiling
2017-06-07 20:11:34 +03:00
Adam C. Foltzer b290688ede look for static Boost libraries on *nix when requested
This was already mostly working before due to how the linker arguments were constructed, but this will now be more resilient to the case where dynamic libraries only are present.
2017-05-25 11:30:55 -07:00
Adam C. Foltzer 80fd7106e8 add support for static flag on Windows Boost dependency 2017-05-25 11:20:29 -07:00
Goncalo Carvalho 6eb75a04a1 fix lookup of boost modules when cross-compiling on osx 2017-05-20 18:57:27 +03:00
Elliott Sales de Andrade ea636fcd51 Remove unused variables. 2017-05-17 04:41:54 -04:00
Elliott Sales de Andrade d3caadb675 Split misc dependencies into their own file. 2017-05-09 18:28:05 -04:00