Commit Graph

459 Commits

Author SHA1 Message Date
Jussi Pakkanen 628f910760
Merge pull request #3314 from sarum9in/test_depends
Add test(depends) keyword parameter
2018-04-18 00:40:52 +03:00
Dylan Baker 92487ea33d Add partial_dependency method to dependencies
This adds a new method, partial_dependency to all dependencies. These
sub dependencies are copies of the original dependency, but with one or
more of the attributes replaced with an empty list. This allows creating
a sub dependency that has only cflags or drops link_arguments, for
example.
2018-04-17 23:33:31 +03:00
Jussi Pakkanen 1952ef5ae1
Merge pull request #3243 from dcbaker/accept-d-setup
Accept -D for meson level options durring initial configuration
2018-04-17 23:29:15 +03:00
Jussi Pakkanen 8ee1e49ae6
Merge pull request #3353 from xclaesse/has-link-argument
Add has_link_argument() and friends
2018-04-17 23:26:53 +03:00
Jussi Pakkanen 3fc1ca8687
Merge pull request #3240 from MathieuDuponchelle/python_module
Implement a generic python module
2018-04-17 23:17:43 +03:00
Dylan Baker 33c5c7e7e9 interpreter: Don't assume default link_args == compile_args
Since we want to make the options passed to `meson` and `meson
configure` equivalent, we need to allows pass -D<lang>_args and
-D<lang>_link_args to `meson`. This path assumes that if one is set then
the other must be, which isn't true.
2018-04-17 11:32:26 -07:00
Xavier Claessens bd37afeeea Add has_link_argument() and friends
Closes: #3335.
2018-04-16 19:14:02 -04:00
Xavier Claessens 521ce883ad has_argument(): reduce code duplication 2018-04-16 19:08:24 -04:00
Nirbheek Chauhan 6cdd14fc4e find_program: Don't spam when called from a module
The user doesn't need to know whether or not the program was found,
especially not when it's spammed for every gnome.foo() function
2018-04-15 14:13:35 +05:30
Nirbheek Chauhan 87c166db95 find_program: Only store successful lookups
Otherwise we can't do the following workflow:

if not find_program('foo', required : false).found()
  subproject('provides-foo')
endif

Where 'provides-foo' has a meson.override_find_program() on
a configure_file() or similar.
2018-04-15 13:32:38 +05:30
Jussi Pakkanen 998892ed29 Updated all modules to work with the new API. 2018-04-15 13:32:38 +05:30
Jussi Pakkanen 4256c0dae2 Can override programs with scripts generated with configure_file. 2018-04-15 13:32:38 +05:30
Jussi Pakkanen bdb57cf62a Convert Gnome module to use find_program from interpreter. 2018-04-15 13:32:38 +05:30
Jussi Pakkanen de65adb8b1 Made it possible to override find_program to return a different program.
Closes https://github.com/mesonbuild/meson/issues/2005
2018-04-15 13:32:38 +05:30
Jon Turney cb597adb01 Indicate subproject depth in console output 2018-04-13 01:05:54 +00:00
David Fort 6dea177774 add support for cmakedefine in configure_file()
The added format argument for configure_file allows to specify the kind of
file that is treated. It defaults to 'meson', but can also have the 'cmake'
or 'cmake@' value to treat config.h.in files in the cmake format with #cmakedefine
statements.
2018-04-08 22:00:45 +03:00
Xavier Claessens 8a70e7cff5 Remove arbitrary [-1024,1024] limit in cross_compute_int()
Copy the algorithm used by autoconf.

It computes the upper and lower limits by starting at [-1,1] and
multiply by 2 at each iteration. This is even faster for small numbers
(the common case), for example it finds value 0 in just 2 compilations
where old algorithm would check for 1024, 512, ..., 0.
2018-04-08 16:56:33 +03:00
Jussi Pakkanen d6e71d0c56
Merge pull request #3312 from MathieuDuponchelle/alwaysfallback
new wrap-mode: forcefallback
2018-04-08 01:08:51 +03:00
Christoph Behle 40715dec21 Move entry in build_funct_dict to correct position.
The entry 'subdir_done' is now at its right place.
2018-04-08 01:04:44 +03:00
Mathieu Duponchelle 31f0242a6f new wrap-mode: forcefallback
This can be useful to make sure that a project builds when
its fallbacks are used on systems where external dependencies
satisfy the version requirements, or to easily hack on the sources
of a dependency for which a fallback exists.
2018-04-06 23:48:48 +02:00
Mathieu Duponchelle e1b138a21b Implement a generic python module
With contributions from Håvard Graff
2018-04-06 22:43:35 +02:00
Xavier Claessens 68f9846b7c Add both_libraries() to build both shared and static libraries
Also support default_library='both' to make library() build both shared
and static libraries.

Closes #484
2018-04-03 15:38:01 -04:00
Xavier Claessens 5eef325ab6 pkgconfig generator: Only skip dependencies when using shared_library()
It is weird and inconsistent to have different pc file depending on
default_library value when using library() or build_target(). We should
skip dependencies only when user explicitly want shared library only.
2018-04-03 15:20:19 -04:00
Xavier Claessens cf0e997167 Remove duplicated list of known kwargs for build targets 2018-04-03 15:20:19 -04:00
Alexis Jeandet 16c4a3b4f8 Added link to documentation and examples for find_library replacement (#3346) 2018-03-31 11:38:09 +03:00
behlec 37d379ebe5 Allow meson build file to exit early. (#2808) 2018-03-29 21:29:45 +03:00
Víctor Manuel Jáquez Leal 6f7f7c69a2 dependency's wanted version might be a list
A dependency declared in a subproject should be able to behave as
a pkgconfig dependency, thus it should process the wanted version
as a list.
2018-03-25 18:27:13 +03:00
Aleksey Filippov c18ceac040 Add depends keyword to test() function 2018-03-25 01:33:33 +00:00
Aleksey Filippov 642df0505a Use unholder=True instead of checking held_object attribute presence 2018-03-25 01:33:33 +00:00
Jussi Pakkanen 30827b5644 Do not install configure_file output if install_dir is empty. Closes #3270. 2018-03-21 21:25:47 +02:00
Jussi Pakkanen 657836b555
Merge pull request #3223 from sarum9in/rename
Add install_data() rename parameter
2018-03-20 00:15:01 +02:00
Nirbheek Chauhan d012b5b997 Create a helper for checking if a string has a path component
This is used in a number of places, and in some places it is incomplete.
Use a helper to ensure it's used properly.
2018-03-19 23:45:43 +02:00
Aleksey Filippov f720efa2f4 Add rename parameter to install_data() 2018-03-17 20:40:50 +00:00
Jussi Pakkanen 9ecb75670f
Merge pull request #3127 from bluetech/method-permitted-kwargs 2018-03-13 21:16:30 +02:00
Jussi Pakkanen 407b6dfc29
Merge pull request #3203 from jukkalaurila/bug3185
Fix bug 3185, "Setting -Dc_args=... option and some others during initial run fails silently'
2018-03-10 18:25:03 +02:00
Jon Turney 8ca2cf03a5 Show info about possible subproject promotion when appropriate
Move call to print_nested_info down into do_subproject()

So we don't print info about possible subproject promotion unless subproject
failure is due to directory non-existence

And we do do that for subproject('foo'), as well as for dependency(fallback:
['foo', ...])
2018-03-10 18:07:32 +02:00
Niklas Claesson 7074bcb88a Exclude subprojects when doing coverage 2018-03-10 18:05:35 +02:00
Jukka Laurila 8789278e5e Fixed bug 3185. 2018-03-09 01:32:32 +01:00
Jussi Pakkanen e98ae58d0e
Merge pull request #3086 from sarum9in/declare-link-whole
Add declare_dependency() link_whole parameter
2018-03-06 21:08:54 +02:00
Evgenii Shatokhin 19718a8d9c Allow passing a compiler object to run_command()
Sometimes it is needed to run the current compiler with specific options
not to compile a file but rather to obtain additional info. For example,
GCC has several -print-* options to query it about the paths to
different libraries and development files. One use case is to get the
location of development files for GCC plugins, which is not easily
obtainable by other means:

  gcc -print-file-name=plugin

For this purpose, it would be convenient if the compiler object returned
by meson.get_compiler(lang) could be used in run_command() directly.
This commit implements it.

Signed-off-by: Evgenii Shatokhin <eshatokhin@virtuozzo.com>
2018-03-06 21:07:16 +02:00
Aleksey Filippov 077d59daa4 Add link_whole argument to declare_dependency() 2018-03-06 01:44:26 +00:00
Jon Turney b8b23f4c50 Fix various flake8 whitespace reports
$ flake8 | grep -E '(E203|E221|E226|E303|W291|W293)'
./run_unittests.py:1503:5: E303 too many blank lines (2)
./mesonbuild/interpreter.py:2342:64: E226 missing whitespace around arithmetic operator
./mesonbuild/minit.py:110:17: E221 multiple spaces before operator
./mesonbuild/minit.py:131:1: W293 blank line contains whitespace
./mesonbuild/minit.py:135:19: E221 multiple spaces before operator
./mesonbuild/minit.py:155:1: W293 blank line contains whitespace
./mesonbuild/minit.py:181:1: W293 blank line contains whitespace
./mesonbuild/minit.py:183:1: W293 blank line contains whitespace
./mesonbuild/minit.py:294:47: W291 trailing whitespace
./mesonbuild/minit.py:331:47: W291 trailing whitespace
./mesonbuild/modules/unstable_icestorm.py:49:1: W293 blank line contains whitespace
./mesonbuild/modules/unstable_icestorm.py:76:31: E203 whitespace before ':'
./mesonbuild/modules/unstable_icestorm.py:82:22: E203 whitespace before ':'
2018-03-03 21:06:45 +00:00
Hemmo Nieminen 4611097654 Include project name in a test object. 2018-02-25 21:44:59 +02:00
Hemmo Nieminen abcaf7c222 Namespace test setups.
Use $project_name:$test_setup namespace scheme for test setups. This
allows one to choose from which (sub)project a test setup is taken from
should there be several sharing the same name. Defaults to the main
project. E.g. "meson test --setup subproj:valgrind".
2018-02-25 21:44:59 +02:00
Hemmo Nieminen ec286d4970 Change an error message when find_program() fails.
Mention all the sought programs in the error message.
2018-02-25 21:44:59 +02:00
Jussi Pakkanen ea3b54d402 Use include_directories for D impdirs.
Change the code to store D properties as plain data. Only convert them
to compiler flags in the backend. This also means we can fully parse D
arguments without needing to know the compiler being used.
2018-02-25 19:42:15 +02:00
Ran Benita 4d8e4654cb Warn if non-permitted keyword arguments are given to compiler methods
This can help future generations avoid mistakes like this:
edb1c66239

To avoid breaking builds, this is currently just an error. After
sufficient time has passed this can hopefully become a hard error,
similarly to the already-existing `permittedKwargs` warnings.
2018-02-23 04:35:15 +02:00
Jussi Pakkanen 55a7c265c1
Merge pull request #2863 from jon-turney/exit-status-on-exception
Verify that failing tests are failing with an error, not a python exception
2018-02-18 13:54:50 +02:00
Jussi Pakkanen 1841d53a84
Merge pull request #2943 from ximion/master
Don't fail loading subprojects if subprojects_dir is in a subdirectory
2018-02-18 13:50:57 +02:00
Matthias Klumpp a64a237d72 Don't mention "error" in error messages
Starting with VS 2017 if the output of any command run by VS contains
the word Error it will interpret that as a fatal error, even if the exit
error code is zero.
This messes up the unit tests on VS 2017, because we sometimes want to
deliberately ignore error messages.
Change "Error" to "Problem" to mitigate this issue until a more
permanent solution is found.
2018-02-17 23:20:26 +01:00