Commit Graph

114 Commits

Author SHA1 Message Date
Daniel Mensinger 15b69d0421 typing: Fully annotate dependencies 2021-06-09 09:46:37 +02:00
Daniel Mensinger 95b70bcb97 deps: Split dependencies.base
Split the Factory and dependency classes out
of the base.py script to improve maintainability.
2021-06-03 10:23:27 -07:00
Dylan Baker 73eb24432b dependencies: split qt out of the ui module
It's a big enough and complicated enough bit of code that it deserves
its own module.
2021-03-22 10:56:13 -07:00
Dylan Baker 40e3577a65 split program related classes and functions out of dependencies
Dependencies is already a large and complicated package without adding
programs to the list. This also allows us to untangle a bit of spaghetti
that we have.
2021-03-19 08:47:10 -04:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Luca Weiss 398df56298 Add Qt6 module 2021-02-07 22:43:00 +02:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
2021-01-04 12:20:58 -08:00
Dylan Baker 71db6b04a3 use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.

this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
2021-01-04 12:20:40 -08:00
Laurent Pinchart d4eec9664b qt: dependency: Strip tool versions from newlines
When finding the Qt compilation tools (moc, uic, rcc, lrelease), the
version strings contain a trailing newline character. This results in a
stray newline in the meson log:

Detecting Qt5 tools
Program /usr/lib64/qt5/bin/moc found: YES 5.14.2
 (/usr/lib64/qt5/bin/moc)
Program /usr/lib64/qt5/bin/uic found: YES 5.14.2
 (/usr/lib64/qt5/bin/uic)
Program /usr/lib64/qt5/bin/rcc found: YES 5.14.2
 (/usr/lib64/qt5/bin/rcc)
Program /usr/lib64/qt5/bin/lrelease found: YES 5.14.2
 (/usr/lib64/qt5/bin/lrelease)

Strip the version to avoid this, resulting in a cleaner log:

Detecting Qt5 tools
Program /usr/lib64/qt5/bin/moc found: YES 5.14.2 (/usr/lib64/qt5/bin/moc)
Program /usr/lib64/qt5/bin/uic found: YES 5.14.2 (/usr/lib64/qt5/bin/uic)
Program /usr/lib64/qt5/bin/rcc found: YES 5.14.2 (/usr/lib64/qt5/bin/rcc)
Program /usr/lib64/qt5/bin/lrelease found: YES 5.14.2 (/usr/lib64/qt5/bin/lrelease)

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-30 11:42:00 +02:00
Eli Schwartz 4a923b699b qt dependency: do not require all the tools automatically
The compilers_detect function is only used in the qt module, which
checks every time before using a specific compiler, if it is found.

e.g.

  meson.build:10:6: ERROR: MOC sources specified and couldn't find moc-qt5, please check your qt5 installation

In fact, the current check means we never even hit this error to begin
with, because we previously died on the uninformative error:

  meson.build:10:6: ERROR: Program(s) ['moc'] not found or not executable

which doesn't actually tell the user why this matters, and is all around
a waste of time.

Fixes #5582
2020-08-07 12:40:31 -04:00
Xavier Claessens f66c8c35da qt: Fix has_tools() when required=False
Improve logs by making it clear when the program is found but has
wrong version.
2020-07-04 13:57:08 +03:00
Dylan Baker 85be45ea11 dependencies: Split search_tool out of ExternalDependency
it really doesn't make sense to put this in the ExternalDependency
class. It doesn't rely on any of the state of that class, and it's
generically useful inside meson.
2020-06-12 11:16:24 -07:00
Dylan Baker 5663b4a3e8 dependencies: Remove finish_init method
This is a holdover from before we had the DependencyFactory. It should
have already been refactored into the initializer, but wasn't for some
reason.
2020-06-10 01:06:25 +03:00
Nirbheek Chauhan 84cfa2bf51 ui/qt: Warn if Android cpu_family is unknown 2020-05-14 11:07:48 +00:00
Matthew Waters bcf29ede06 ui/qt: use new directory layout for qt on android
Now follows ios and other platform directory layouts.  Moves from
separate android_$arch directories to every library containing a _$arch
suffix.  e.g. libQt5Core_x86.a in a single directory.
2020-05-14 11:07:48 +00:00
Cerbero df5113252b qt dependency: Pick debug libraries based on b_vscrt
`b_vscrt` has existed forever, and is the canonical source for
which CRT to link to, and hence whether to use the debug libraries
or not.
2020-04-05 13:39:41 +03:00
Dylan Baker f6e50da49a dependencies/base: Make the ConfigTool Dependency more flexible 2020-03-19 14:45:08 -07:00
nikolayp 42931a82e1 depdenencies/qt: Second attempt to allow qt --no-framework on MacOS.
Sometimes qt can be installed not as framework on MacOS. One way to
achieve this behaviour is to use conan package manager.

Allow falling back to simple library search if framework was
not found. In addition, allow to find the debug version of qt debug
libraries which have "_debug" suffix added to them.

Fixes #5091
2020-02-05 22:16:54 +02:00
Dylan Baker 235b7a69e7 dependencies/ui: Honor static argument with wxwidgets
Fixes #6564
2020-02-05 09:24:32 -08:00
Dylan Baker f3773fa5c6 dependencies/ui: Add type annotations to WxDependency 2020-02-05 09:16:11 -08:00
Dylan Baker 68842f535f dependencies/ui: wxwidgets requires C++
so set the language field appropriately
2020-02-05 09:13:32 -08:00
Xavier Claessens 8201b725ed Qt5: Do not use system qmake if not specified in cross file
There is a comment saying we do it because we used to do it. But it's
wrong and lead to using system library when cross compiling.

Factor out the code we use to find pkg-config, because it is the same
use-case.
2020-01-30 00:01:42 +02:00
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