Commit Graph

52 Commits

Author SHA1 Message Date
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
Alexis Jeandet f3a8efc11b Added Added Qt's private header support with pkg-config
Just use the same approach than qmake to generate private headers path

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-04-30 11:43:54 +02:00
Alexis Jeandet f784ee62ea Fixed private headers on OSX with framework stuff
Removed Qt4 private headers test since it's hard to get Qt4 private
headers installed on CI.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-04-28 23:36:05 +02:00
Alexis Jeandet 0045d95a16 really switch to qmake automatically if pkg-config fails
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-04-28 18:23:26 +02:00
Alexis Jeandet 2fc0a11062 [Qt module] Privates headers: Implemented private_headers option
This commit adds private_headers option in dependency method which tells
QtDependency to add private headers include path to build flags.
Since there is no easy way to do this with pkg-config only qmake method
supports this, so with private_headers set qmake will always be used.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-04-28 17:14:31 +02:00
Jon Turney daaa49c622 Fix "meson 'test cases/frameworks/4 qt master' _build -Dmethod=qmake" on OSX
ExtraFrameworkDependency doesn't support any method: other than auto, so
handing down the method: used from QtBaseDependency leads to (sic):

meson.build:13:2: ERROR: Unsupported detection method: qmake, allowed methods are auto and auto
2018-03-04 22:28:47 +00:00
Jon Turney 590b6dec97 Fix reporting of Qt detection method used on OSX
Ensure that from_text is set to the name of the qmake executable we used,
rather than the return value of _framework_detect(), which is always 'None'
2018-03-04 22:28:47 +00:00
Jon Turney 02def38741 Fix QtBaseDependency._framework_detect
At the moment, QtBaseDependency._framework_detect sets is_found if at least
one module is found.  This gives the incorrect result in the case where both
found and not-found modules are given.

Fix it so it only sets is_found if all the modules given are found.
2018-03-04 22:28:47 +00:00
Jon Turney 0eade4f3c6 Fix dependency('qt4|5', method: 'qmake') for Cygwin
Fix dependency('qt4|5', method: 'qmake') detection when shared library
extension isn't .so

Note that OSX already has a special case to look for .framework
2018-03-04 22:28:46 +00:00
Jon Turney cd5dba5358 Fix flake8 'imported but unused' reports
$ flake8 | grep F401
./meson.py:17:1: F401 'mesonbuild.mesonlib' imported but unused
./meson.py:18:1: F401 'locale' imported but unused
./run_unittests.py:24:1: F401 'sys' imported but unused
./mesonbuild/minit.py:2:1: F401 'pyclbr.Function' imported but unused
./mesonbuild/minit.py:18:1: F401 'os' imported but unused
./mesonbuild/backend/vs2010backend.py:15:1: F401 'sys' imported but unused
./mesonbuild/backend/xcodebackend.py:19:1: F401 'sys' imported but unused
./mesonbuild/dependencies/ui.py:20:1: F401 'shutil' imported but unused
./mesonbuild/modules/python3.py:15:1: F401 'sys' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..compilers' imported but unused
./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..mlog' imported but unused
./test cases/common/98 gen extra/srcgen3.py:3:1: F401 'os' imported but unused
2018-03-03 21:06:45 +00:00
Aleksey Filippov 56c6489a6c Fix wxwidgets dependency: pass modules to wx-config
Fixes #3123
2018-02-22 20:27:19 +02:00
Jon Turney 57cb597871 Same for Vulkan 2018-01-15 20:28:25 +00:00
Jon Turney 3748f5465a Same for SDL2 2018-01-15 20:28:24 +00:00
Jon Turney c59ec87496 Create GL dependency objects via a factory function
Create GL dependency objects via a factory function, so they can be the
correct type of object (e.g. a PkgConfigDependency when it's found by
pkg-config)

Factor out method: kwarg processing, so it can be used by the factory before
the dependency object is constructed
2018-01-15 20:28:23 +00:00
Jon Turney 8efdcca930 Make Dependency.get_methods() a static method
Since this is only consulted while constructing the Dependency object, it's
result doesn't depend on the instance (and it would make no sense if it did)
2018-01-15 13:12:29 +00: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
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
Iñigo Martínez 44dd429ee5 dependencies: Fix pkg-config variable definition
In a previous commit variable definition was added in pkg-config.
However, this commit was not complete.

This fixes the missing parts of that commit.
2017-12-01 13:49:01 +01: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
Dylan Baker 8e53dec314 Use ConfigToolDependency for SDL2 2017-11-23 19:54:48 -08:00
Dylan Baker 38e2c0e8f5 Make GnuStepDependency a ConfigToolDependency 2017-11-23 19:54:48 -08:00
Dylan Baker 061cf99cd6 Make WxDependency a ConfigToolDependency 2017-11-23 19:54:48 -08:00
Dylan Baker 22fed0b424 Fix wrapping of docstrings in GnuStep dependency. 2017-11-23 19:54:47 -08:00
Alexis Jeandet 1fd743e6ad [Qt module] Added lrelease detection
Just detect lrelease as done with other Qt tools.
Uses -version instead of -v to probe version since lrelease don't
support it.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-22 23:28:32 +01:00
Nirbheek Chauhan d2a250412c compilers: Improve manual library searching
We can now specify the library type we want to search for, and whether
we want to prefer static libraries over shared ones or the other way
around. This functionality is not exposed to build files yet.
2017-11-11 23:06:48 +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
nyorain ec445c3598 Fix vulkan style issue 2017-07-27 12:10:12 +02:00
nyorain 6dd9098cd7 Fix vulkan windows; Make test succeed w/o driver
Fix an error in the windows vulkan_sdk library finding.
Also don't fail the vulkan test only because no vulkan
driver is installed (should fix the travis error).
2017-07-27 12:05:08 +02:00
nyorain 02e5c58efc Fix style issue in vulkan dep 2017-07-25 23:25:00 +02:00
nyorain 005e041645 Fix vulkan module for linux
Rework the vulkan module:
	- adopt the VULKAN_SDK paths for its linux version
	- add sanity tests for the VULKAN_SDK path
	- add guessing as last fallback, needed on linux systems
	  on which no vulkan pkgconfig is installed [ubuntu atm]
	- restructure exception handling/branching

Not tested on windows yet.
2017-07-25 23:20:05 +02:00
nyorain 0c2ef49dc5 Trigger travis 2017-07-25 21:49:01 +02:00
nyorain 2174027ba1 Fix whitespace issues 2017-07-24 18:49:23 +02:00
nyorain 29e2aac690 Add first vulkan dependency module 2017-07-24 18:30:23 +02:00
Jussi Pakkanen b2a90f1838 Removed unnecessary pass statements. 2017-07-16 12:02:48 +03:00
Philippe Payant e4daad369a Select release or debug libraries for Qt, based on buildtype. 2017-06-27 11:56:21 -04:00
Philippe Payant 85eddf4eb2 Library names for Qt4 was incorrect. 2017-06-27 11:56:21 -04:00
Jussi Pakkanen 7c7dc0efde Fix a stray variable renaming. Closes #1952. 2017-06-18 03:48:59 +03:00
Nirbheek Chauhan 1441cb9812 wxwidgets: Fix usage of multiple dependency() calls
This was broken because the class property will say True but the
object property will not be set. Store the value on the class property
and transfer to object in __init__. Just like PkgConfigDependency.
2017-06-17 12:33:06 +03:00
Nirbheek Chauhan c1e9c757eb tests: Increase dependencies coverage a bit more 2017-06-10 00:20:03 +05:30
Nirbheek Chauhan c4d7667675 ExtraFrameworkDependency: Don't set required
Otherwise we will never hit the informative DependencyException.
2017-06-09 20:21:01 +05:30