Commit Graph

35 Commits

Author SHA1 Message Date
Jussi Pakkanen c23c822196 Only add src_include_dir if it has been defined. 2016-11-14 11:43:37 -05:00
Jussi Pakkanen 08c82fd17c Merge pull request #1042 from centricular/fix-qt4-testcase-qtwidgets
qt: Fix qmake detection on Linux and Windows
2016-11-13 12:38:17 -05:00
Jussi Pakkanen 918b8d098d GTest and GMock changed their entire project layout on 1.8.0. Again. Fix it. 2016-11-13 11:00:04 -05:00
Nirbheek Chauhan 69aafd141e qt: Fix qmake detection on Linux and Windows
qmake for both Qt4 and Qt5 detection was assuming that it was only used
on Windows, which is incorrect. It can also be used on Linux for
cross-compilation or in general when pkg-config is not available.

It was also not failing properly for both Qt5 and Qt4 when no libraries
were found, and was assuming that the .dll was always available.

Qt4 detection with qmake was also completely broken.

Also prevents unwanted injection of partially-found qt dependencies in
targets by unsetting self.cargs and self.largs
2016-11-13 16:50:09 +05:30
Nirbheek Chauhan 085650a1e3 vala: Implement valac.find_library
Move CCompiler.compile to Compiler.compile so that ValaCompiler can use
it. Also rewrite ValaCompiler.sanity_check to use it since it does
a simple compile check.

At the same time, it enhances ExternalLibrary to support arguments for
languages other than C-like.

Includes a test for this that links against zlib through Vala.

Closes #983
2016-11-12 13:56:17 -05:00
Nirbheek Chauhan a72740a0d1 qt deps: New abstract impl and several fixes
* Simpler picking of pkg-config vs qmake detection
* qmake-based detection now allows specifying qmake via cross-info
* bindir is now stored from qmake/pkg-config detection and can be used
  to detect qt tools such as moc, uic, rcc with self.compilers_detect()
* Qt4 dependencies got some love; now they share the implementation with
  Qt5 since the two are very similar; basically identical
* Don't ask about Qt3
2016-11-11 01:51:02 +05:30
Nirbheek Chauhan f79c4396f8 Add repr() implementation for Dependency()
Easier to debug
2016-10-23 18:02:02 +05:30
Jussi Pakkanen e908910187 Can query pkg-config variables from the system. Closes #726. 2016-10-19 22:36:34 +03:00
Thibault Saunier 7e2390f355 interpreter: Add a type_name method to DependencyHolder
And remove the InternalDependencyHolder class.

In some cases we need to know the type of dependency we are
dealing with. For example in GStreamer if the dependency
is not an internal one, then we need to get some env var
from pkg-config to know where to find some plugins necessary
to run some tests.
2016-10-14 11:25:15 +02:00
Nirbheek Chauhan 6ffae922cc Add a unittest for pkg-config file generation
This also tests that -lfoo is correctly added to libfoo.pc when the
library name is 'libfoo' and name_prefix is ''
2016-10-13 02:19:02 +05:30
Nirbheek Chauhan 5e384b8396 dependencies: Use a wrapper for calling pkg-config
Reduces duplicated code, and also use universal_newlines=True which
avoids having to decode the bytes output to string.

We mostly need this so we can pass the *current* process environment to
pkg-config which might've changed since the module was imported. Without
this, subprocess.Popen invokes pkg-config with a stale environment (used
in the unittest added later)
2016-10-13 02:18:24 +05:30
Thibault Saunier 6eacca2024 dependencies: Fix traceback always setting 'variable'
if pkg-config return != 0 and the dep is not required, it will not be set
2016-10-10 19:41:43 +03:00
Nirbheek Chauhan a0551d7d6e dependencies/boost: Fix 32-bit vs 64-bit on Windows
Fixes https://github.com/mesonbuild/meson/issues/526

Also removes useless and incorrect mesonlib.is_32bit() function. We
cannot trust that the architecture that Python is built for is the same
as the one we're targetting.
2016-09-27 00:27:38 +05:30
Nirbheek Chauhan c9a7422cc1 dependencies/boost: Require BOOST_ROOT while cross-compiling
Our fallback to the system-provided directories is never going to work
while cross-compiling
2016-09-27 00:27:38 +05:30
Jussi Pakkanen ba0456748e Prefer pkg-config to sdl2-config. 2016-09-04 20:22:20 +03:00
Elliott Sales de Andrade 4c71695e41 Use context manager for file I/O.
There are a few cases where a context manager cannot be used, such as
the logger.
2016-08-27 18:29:55 -04:00
ippytraxx 9aef099bc7 'name' needs to be 'self.name' in DependencyException 2016-08-23 23:15:46 +02:00
Nirbheek Chauhan 577b6dfdf6 find_program: Find scripts without extensions on Windows
Because of how files and executables work on Windows, scripts that use
an interpreter must have an extension, and that extension must be
associated with an interpreter. The full list of executable extensions
is available in the PATHEXT environment variable.

However, UNIX-like OSes use an executable bit and read the shebang to
figure out what interpreter to use, and the scripts don't need to have
extensions. We can now detect these scripts using find_program by
manually searching in PATH and reading the shebang.
2016-07-30 15:20:01 +05:30
Nirbheek Chauhan baf8481c4f pkg-config: Print 'NO' when version is too old
This gives a clearer output when the dependency is not required or has a
fallback subproject otherwise the user is left wondering why the optional
dependency wasn't used or why the fallback subproject is being used.
2016-07-28 21:11:45 +05:30
Nirbheek Chauhan 48b4defa37 pkg-config: Move setting of cargs and libs to functions
Much cleaner this way. It's completely clear what each block of code does.
2016-07-28 21:06:00 +05:30
Nirbheek Chauhan bc63103ae0 pkg-config: Short-circuit when there's no pkg-config file found
Just exit immediately when there's no pkg-config file found instead of putting
everything else in a huge 'else:'. Much clearer and avoids one level of
indentation.

No code changes accompany this.
2016-07-28 21:02:02 +05:30
Thibault Saunier a23f577415 dependencies: Add a get_version method to Python3Dependency
Otherwise ninja files regeneration fails with:

  AttributeError: 'Python3Dependency' object has no attribute 'get_version'
2016-07-04 13:01:23 -04:00
Jussi Pakkanen 35eb8c7b9a Added version info to sdl2dep. Closes #616. 2016-06-24 15:45:25 +03:00
Nirbheek Chauhan cd509043e0 wxwidgets: Don't error out if dependency is not required (#606) 2016-06-21 00:16:11 +03:00
Jussi Pakkanen f9910d2c11 Ensure cargs and libs variables always exist. Closes #581. 2016-06-09 21:48:27 +03:00
Nirbheek Chauhan c33e7a68a1 Also reuse subproject-based fallback dependencies
This allows a project to use the same fallbacks dependency from the same
subproject multiple times in the same way that external dependencies can be.

Also change the format of the dependency identifier to ensure that fallback
checks with different dirname/varname aren't mistakenly reused. We now use
a tuple for this because the format is simpler to construct and it gives us the
same immutability guarantees as a string which is needed for using it as
a dictionary key.
2016-05-30 03:35:02 +05:30
Jussi Pakkanen cff4e7d299 Can query version strings of dependencies. 2016-05-29 03:15:16 +03:00
Hemmo Nieminen 336904b553 Move MesonException from coredata to mesonlib. 2016-04-01 00:52:45 +03:00
Jussi Pakkanen 8b6848ebc3 Add dir support for find_library and remove deprecated standalone version. Closes #450. 2016-03-17 20:55:19 +02:00
Jussi Pakkanen 6b548a1c75 Added find_library method and deprecated the standalone version. Closes #396. 2016-03-12 17:00:55 +02:00
Jussi Pakkanen 52b66edb6c Can specify compile and link args for internal deps. 2016-02-29 21:28:16 +02:00
Jussi Pakkanen a04c33e125 Can build Python extension on OSX. 2016-02-21 17:12:09 +02:00
Jussi Pakkanen 98d3fb5372 Extract python3 dependency information from the current process if it is not available in pkg-config. 2016-02-21 14:53:36 +02:00
Jussi Pakkanen 25793975d7 Can ask pkg-config to provide static libraries. Closes #380. 2016-02-14 20:13:17 +02:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00