Commit Graph

92 Commits

Author SHA1 Message Date
Dylan Baker 47502f8adf dependencies: Use DependencyFactory for sdl2 2020-01-29 09:11:24 -08:00
Dylan Baker 0dbe9f6159 dependencies: Use DependencyFactory for gl 2020-01-29 09:11:24 -08:00
Dylan Baker c17fa3223f dependencies: Use DependencyFactory for Vulkan 2020-01-29 09:11:24 -08:00
Dylan Baker fd892ad7ce dependencies: Make Dependency initializer signatures match
Currently PkgConfig takes language as a keyword parameter in position 3,
while the others take it as positional in position 2. Because most
dependencies don't actually set a language (they use C style linking),
using a positional argument makes more sense. ExtraFrameworkDependencies
is even more different, and duplicates some arguments from the base
ExternalDependency class.

For later changes I'm planning to make having all of the dependencies
use the same signature is really, really helpful.
2020-01-29 09:11:24 -08:00
Dylan Baker f85d6cee6a dependencies/base: Split process_method_kw out of Dependency
I want to use this in a new class as well, that doesn't descend from
Dependency.
2020-01-29 09:11:24 -08:00
Jon Turney 65cb6852ae
Fix dependency('qt') crash with old Qt on OSX
Don't fail with 'KeyError: QMAKE_XSPEC' if `qmake -query` doesn't report
QMAKE_XSPEC. (Seen with 4.8.7)
2020-01-17 15:44:35 +00:00
Daniel Mensinger e4a0ee205d lgtm: Fix redundant code 2019-12-05 00:22:10 +02:00
Chun-wei Fan 7677a38e1a dependencies/ui.py: Fix Vulkan detection on Windows
We might be using the 32-bit bits of the VulkanSDK on Windows on x64
Windows, so we still need to pass in the compiler items to detect what
architecture we are building for, so that we link to the correct Vulkan
libraries.

We might want to look into this again if Microsoft will allow ARM/ARM64
versions of the Vulkan drivers and SDK, since post-basic OpenGL and
any Vulkan are not supported on Windows-on-ARM.
2019-11-25 14:04:43 +02:00
Roman Shpuntov 3b17344b11 tvOS: added support AppleTVOS 2019-06-13 21:31:03 +03:00
John Ericson 07777e15d4 Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.

As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
2019-06-09 13:13:25 -04:00
Dylan Baker c0aa89e57f
Merge pull request #4952 from mensinda/cacheCompiles
Cache compilers.compile() in coredata
2019-05-02 14:54:02 -07:00
Daniel Mensinger e75211d321
Fix builtin variable names 2019-04-29 12:17:40 +02:00
Daniel Mensinger 8a32fc8dbe
Disable cache for dependencies 2019-04-28 14:33:22 +02:00
Daniel Mensinger dfe3d56bfd
Print '(cached)' when compiler result was cached 2019-04-28 14:33:21 +02:00
Nirbheek Chauhan 8a7537ce24 qt: Only look for a framework on macOS if building for macOS
When building for iOS, the Qt binaries only contain static libraries
and headers. No framework.

With this, Meson can successfully compile and link to Qt on iOS
2019-02-01 07:27:35 +00:00
Nirbheek Chauhan bd8eff7438 qtdep: Look for QMAKE env var again + sprinkle debug
We used to look for the QMAKE env var in earlier versions of Meson,
start looking for it again.
2019-02-01 00:14:09 +05:30
Nirbheek Chauhan c0166355ce Rewrite appleframework and extraframework dependency classes
Instead of only doing a naive filesystem search, also run the linker
so that it can tell us whether the -F path specified actually contains
the framework we're looking for.

Unfortunately, `extraframework` searching is still not 100% correct in
the case when since we want to search in either /Library/Frameworks or
in /System/Library/Frameworks but not in both. The -Z flag disables
searching in those prefixes and would in theory allow this, but then
you cannot force the linker to look in those by manually adding -F
args, so that doesn't work.
2019-02-01 00:14:09 +05:30
Nirbheek Chauhan 4bfe0a2568 gnustep-config: config tools are lists, not strings
More programming errors exposed by not ignoring all exceptions.
2019-01-31 20:12:21 +05:30
Nirbheek Chauhan c5a78c9e49 qt: Print the full path of the `qmake` binary found 2019-01-30 13:54:16 +05:30
Michael Hirsch, Ph.D da34bea893 pep8 py37 2019-01-29 22:06:11 +02:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00
Dylan Baker c1e416ff61 dependencies/ui: Fix qmake detection when not using cross or native file
Fixes #4641
2018-12-19 23:15:10 +02:00
Dylan Baker d3e638fcbd dependencies/ui: Fix Qt pkg-config detection on MacOS
Since 0.46.1 pkg-config detection has been broken using the qt from homebrew,
due to a bug in homebrew (I think). Tested with qt 5.12.0 on Mojave.
2018-12-19 23:15:10 +02:00
Dylan Baker f126f43c4f dependencies/ui: Don't require lrelease for qt
We previously didn't require it so we shouldn't silently start doing so.

Fixes #4654
2018-12-19 10:15:17 +02:00
Dylan Baker 9f675cc55a dependencies/ui: Fix qt compiler detection when bindir is set
Fixes: #4527
2018-11-22 23:37:16 +02:00
Dylan Baker aa04147a4a dependencies/ui: Allow qt compilers and qmake to be specified in native file 2018-11-14 15:57:37 -08:00
Dylan Baker 95403cb615 replace ExternalProgram.from_cross_info with from_bin_list
This more generic method will also be used to check a config file for
binary information.
2018-11-14 15:57:37 -08:00
Jon Turney 4fc1ca20b6 Fix incorrect checking of build machine for dependency availability
Don't check the build machine to determine a dependency whose availability
is static property of the host machine
2018-11-02 21:39:02 +02:00
Jan Niklas Hasse d0648ee077 Also check wx-config-gtk3 when looking for wxWidgets
On Arch Linux the wxgtk3 package doesn't provide wx-config.
2018-09-17 21:43:50 +03:00
Alexey Rochev 0667e8494c Qt: set QT_<MODULE>_LIB defines when using qmake detection 2018-09-11 20:22:37 +03:00
Jon Turney 39d87269b3 Add missing reporting of some methods tried to find the dependency
Make us report 'system' and 'framework' when we tried those methods to
locate the dependency.
2018-09-10 21:02:18 +03:00
Jon Turney 593de37474 Fix duplicate PKGCONFIG case in VulkanDependency
A mistake in 82bdf07a
2018-09-10 21:02:18 +03:00
Jon Turney 1768b09a12 Improve formatting of dependency details
Also use a more consistent format for qmake details, and adjust a test case
which relies on the specific output
2018-09-10 21:02:18 +03:00
Alexey Rochev 929fbb9353 Qt: add main argument to Qt dependency object to link with qtmain library on Windows (#2327) 2018-09-10 21:00:36 +03:00
Jon Turney 6a4c2d63d7
Comparison with an unknown dependency version should always fail
Consistently use None to store an unknown dependency version (rather than
'none', 'unknown' or some made up version)
2018-08-26 17:23:39 +01:00
Jon Turney e75b7cdc15
Fix a misplaced bracket in GLDependency constructor
This is a typo in 82bdf07a
2018-08-26 17:23:39 +01:00
Jon Turney f2673d9b57
Consolidate reporting result of a dependency check
If successful, we should identify the method which was successful
If successful, we should report the version found (if known)
If failing, we should identify the methods we tried

Some dependency detectors which had no reporting now gain it

There's all kinds of complexities, inconsistencies and special cases hidden
in the existing behaviour, e.g.:

- boost reports modules requested, and BOOST_ROOT (if set)
- gtest/gmock report if they are a prebuilt library or header only
- mpi reports the language
- qt reports modules requested, and the config tool used or tried
- configtool reports the config tool used
- llvm reports if missing modules are optional (one per line)

We add some simple hooks to allow the dependency object to expose the
currently reported information into the consolidated reporting

Note that PkgConfigDependency() takes a silent: keyword which is used
internallly to suppress reporting.  This behaviour isn't needed in
find_external_dependency().
2018-08-01 14:26:01 +01:00
Jon Turney 3576623b0f
Consolidate raising a DependencyException() if required but not-found
This is now done by find_external_dependency() in all cases

I can't help but think this perhaps should be in a few more places...
2018-08-01 14:26:00 +01:00
Jon Turney 01118ce2a4
Add a finish_init callback to ConfigToolDependency()
Give ConfigToolDependency() a finish_init callback, so that tool-specific
initialization can be called from the constructor, rather than after
construction in the factory class.

v2:
finalize -> finish_init for clarity
2018-08-01 14:25:59 +01:00
Jon Turney 82bdf07a9d
Hoist trying several dependency detection methods up to find_external_dependency()
find_external_dependency() now makes and iterates over a list of callables
which are constructors with bound arguments for the dependency objects we
are going to attempt to make, so we can consolidate reporting on these
attempts and handling failures in that function.
2018-08-01 14:25:58 +01:00
Nirbheek Chauhan a1d9adba09 FeatureNew: Make all checks subproject-specific
We now pass the current subproject to every FeatureNew and
FeatureDeprecated call. This requires a bunch of rework to:

1. Ensure that we have access to the subproject in the list of
   arguments when used as a decorator (see _get_callee_args).
2. Pass the subproject to .use() when it's called manually.
3. We also can't do feature checks for new features in
   meson_options.txt because that's parsed before we know the
   meson_version from project()
2018-07-02 19:52:53 +05:30
Nirbheek Chauhan ec29f19c12 Add a helper for fetching of binaries from cross files
A number of cases have to be taken care of while doing this, so
refactor it into a helper on ExternalProgram and use it everywhere.

1. Command is a list of len > 1, use it as-is
2. Command is a list of len == 1 (or a string), use as a string
3. If command is an absolute path, use it as-is
4. If command is not an absolute path, search for it
2018-07-01 13:59:48 +00:00
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
Matthew Waters 4edec259ca modules/qt: check for un-suffixed moc,rcc,uic on windows
The windows Qt installer doesn't ship with suffixed versions of the qt
tools.
2018-06-10 23:55:21 +03:00
Matthew Waters a7fc3fe356 dependencies/qt: fix debugoptimized builds with qt
debugoptimized builds building against Qt would ultimately link against
both the debug and non-debug msvcrt, ntdll, etc libraries which causes
crashes in weird places and is very much not recommended by Microsoft.

This changes the selected Qt library(ies) correctly to not uses the
debug variants for debugoptimized builds.

https://github.com/mesonbuild/meson/pull/3680
2018-06-07 12:56:49 +00:00
Xavier Claessens 00414a326a dependencies: Take options from coredata instead of cmd line
These are the last remaining places where attributes set by argparse for
"--builtin-option" are used.
2018-06-06 20:02:37 +00:00
Nirbheek Chauhan f9f3a51243 Revert "really switch to qmake automatically if pkg-config fails"
This reverts commit 0045d95a16.

<jeandet> nirbheek, it seems 0045d95a16 is
really wrong, I've tested on Ubuntu.  While writing this line I was
thinking that you can't have Qt without a working qmake in the path. On
Ubuntu you have that qtchooser stuff which is misleading.
2018-06-06 18:35:59 +00:00
Salamandar 4741f1e243 Add 0.42.0 features 2018-06-01 14:23:24 +02:00
Jussi Pakkanen cc3e0bc469
Merge pull request #3491 from jeandet/qt_private_headers
Qt private headers
2018-05-27 23:50:30 +03:00
Jussi Pakkanen 160da30732 Typos are fun. [skip ci] 2018-05-24 22:19:49 +03:00