Commit Graph

660 Commits

Author SHA1 Message Date
Jussi Pakkanen fb2cdd0fe2 Call it gnu_symbol_visibility instead. 2018-08-09 19:46:49 +03:00
Jussi Pakkanen 6a0e674043 Add kwarg for specifying symbol visibility. 2018-08-09 19:46:49 +03:00
Nirbheek Chauhan a8694f4b26 Don't check version for fallback not-found dependency
Otherwise we get an error while checking the subproject version:

  Uncomparable version string 'none'.

If the dependency was found as a not-found dependency in the
subproject and is not required, just take it.
2018-08-08 19:31:13 +03:00
Nirbheek Chauhan 8402a22233 Test that vim syntax highlighting is up-to-date
Needs a `mock` kwarg to Interpreter to not do any parsing of build
files, but only setup the builtins and functions.

Also consolidate the documentation and data tests into one class.
2018-08-07 12:54:56 -07:00
Patrick Griffis e45ab8b24c Fix missing permitted kwarg
get_pkgconfig_variable() takes a 'default' keyword
2018-08-07 06:38:43 -07:00
Nirbheek Chauhan a2dab5439c custom targets: Add a 'console' kwarg for long-running commands
Ninja buffers all commands and prints them only after they are
complete. Because of this, long-running commands such as `cargo
build` show no output at all and it's impossible to know if the
command is merely taking too long or is stuck somewhere.

To cater to such use-cases, Ninja has a 'pool' with depth 1 called
'console', and all processes in this pool have the following
properties:

1. stdout is connected to the program, so output can be seen in
   real-time
2. The output of all other commands is buffered and displayed after
   a command in this pool finishes running
3. Commands in this pool are executed serially (normal commands
   continue to run in the background)

This feature is available since Ninja v1.5

https://ninja-build.org/manual.html#_the_literal_console_literal_pool
2018-07-31 19:38:54 +03:00
Jussi Pakkanen e75f6e4305
Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacks
Be more permissive about not-found exe_wrapper
2018-07-31 19:33:06 +03:00
Nirbheek Chauhan 0ea21d7aea Add a feature-new entry for UserFeatureOption
Since we can't detect it in meson_options.txt, detect it when the
option is used.
2018-07-25 08:02:49 -07:00
Jussi Pakkanen 306fa07f62
Merge pull request #3893 from FFY00/master
Add dlang module (dub support)
2018-07-21 02:46:11 +03:00
Jussi Pakkanen f390a0a2f3
Merge pull request #3814 from behlec/configure-file-output
Check if calls to configure_file write to the same output file.
2018-07-19 01:17:34 +03:00
Nirbheek Chauhan 416a00308f cross: Use ExternalProgram for cross-file exe_wrapper
We already have code to fetch and find binaries specified in a cross
file, so use the same code for exe_wrapper. This allows us to handle
the same corner-cases that were fixed for other cross binaries.
2018-07-09 04:09:46 +05:30
Nirbheek Chauhan 78f1ef85fd
Add missing method on external library object: type_name() (#3845)
For some reason this was missing, but it should've always existed
since cc.find_library() returns an object that is internally an
ExternalDependency instance.
2018-07-08 10:58:07 -07:00
Christoph Behle 430506f814 Use mlog.bold to add quotes 2018-07-08 19:46:36 +02:00
Christoph Behle 2f494d2ccf Simplified and cleaned up warning. 2018-07-08 18:19:17 +02:00
Christoph Behle 2d5e1e24a1 Consider subdir for output files.
Files will only clash if in the same subdir.
Print the subdir in the warning.
2018-07-07 21:20:23 +02:00
Christoph Behle 620c0b07a9 Track line numbers for configure_file.
Track line numbers of calls. Warning reports now the line number of the
first and the current write to the same file.
2018-07-07 21:20:23 +02:00
Christoph Behle 07f5a5e490 Add warning if configure_file overwrites output.
Record the output for each call to configure_file.
If a previous output is overwritten print a warning.
2018-07-07 21:20:23 +02:00
Nirbheek Chauhan 2093d45a4e Print a more usable message when a subproject fails to configure
Instead of just printing the message in the exception, if it's
a MesonException, also print the file and the line number. If it's an
unknown exception, print the entire traceback so that we can pin-point
what the Meson bug causing it is.
2018-07-07 04:33:24 -07:00
Nirbheek Chauhan 80392225a6 Raise a MesonException when substituting an invalid value
Avoids throwing a traceback. Also, warn when setting such a value.
2018-07-07 04:33:24 -07:00
Nirbheek Chauhan 4fb00ee1d8 Add new method: mlog.deprecation()
Instead of constructing it manually, use a helper.
2018-07-07 04:33:24 -07:00
Nirbheek Chauhan 1415cd2d07 mlog: Add built-in support for quoting bolded messages
This allows us to drop wonky sep='' hacks and manual addition of
spaces across the codebase.
2018-07-06 06:25:12 +00:00
Nirbheek Chauhan 602e58d398 configure_file: Don't optimize away substitutions
It's possible that the configuration data object has components added
conditionally, and that sometimes an empty configuration data object
is passed on purpose.

Instead, we do the substitution and also warn if no tokens were found
that could've been substituted.

Closes https://github.com/mesonbuild/meson/issues/3826
2018-07-04 00:25:01 +00:00
Nirbheek Chauhan d6a9b4cc79 Contributing.md: Document procedure for new features [skip ci] 2018-07-02 19:52:53 +05:30
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 a524524ac0 interpreter: Use is_subproject() everywhere 2018-07-02 07:05:08 +00:00
Nirbheek Chauhan 907a68bcf1 FeatureNew: Fix method names for some feature checks 2018-07-02 07:05:08 +00:00
Salamandar df1970d3ad Various bug fixes for FeatureNew
* Use _get_callee_args to unwrap function call arguments, needed for
  module functions.

* Move some FeatureNewKwargs from build.py to interpreter.py

* Print a summary for featurenew only if conflicts were found. The
  summary now only prints conflicting features.

* Report and store featurenew/featuredeprecated only once

* Fix version comparison: use le/ge and resize arrays to not fail on
  '0.47.0>=0.47'

Closes https://github.com/mesonbuild/meson/issues/3660
2018-07-02 07:05:08 +00:00
Jussi Pakkanen dc683218a4
Proper error message for non-found exe in run_target. Closes #3818 2018-07-01 19:45:03 +03:00
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 ae8d044cb6 Allow command lists for find_program cross file overrides
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes https://github.com/mesonbuild/meson/issues/3737
2018-07-01 13:59:48 +00:00
Jon Turney c151eb4967 Improve logging when dependency is anonymous
Various pieces of logging assume the dependency has a name, and aren't
grammatical if the dependency is '', so say it is anonymous instead.
2018-06-30 13:28:15 +00:00
Jon Turney fd4872ae77 More tests to cover missing fallback for a non-found dependency
Fix logic so we correctly raise an exception about missing fallback in the
case where the dependency is required.
2018-06-30 13:28:15 +00:00
Jon Turney 9efdcfbb8d Fix handling of dependency('', fallback: ['subproject', 'dep'])
Also extend a test case to cover this.
2018-06-30 13:28:15 +00:00
Jussi Pakkanen bde99eb6c4 Warn if using Clang+asan+b_lundef. Closes #764. 2018-06-30 00:50:06 +03:00
Niklas Claesson 9620755ff7 Print default option values that don't match the current value 2018-06-21 00:56:30 +03:00
Nirbheek Chauhan 58ae2c9a8c Rename clike_langs to clink_langs for clarity
D is not a 'c-like' language, but it can link to C libraries. The same
might be true of Rust in the future and Go when we add support for it.

This contains no functionality changes.
2018-06-20 11:27:08 +00:00
Jon Turney 5f5480f337 Make a custom target output dir as an include dir relative to @BUILD_ROOT@
Make a custom target output dir as an include dir relative to @BUILD_ROOT@,
so that path is constructed correctly when using the absolute path forms
used by the MSVC backend.
2018-06-18 10:52:21 +00:00
Jon Turney 7c4b8591b0 Make depends: of windows.compile_resources() include-able
Add the output directories for any custom target in depends: to the resource
compiler include path
2018-06-18 10:52:21 +00:00
Nirbheek Chauhan c9a89027ac run_command: Add new kwarg 'capture'
capture: false means we won't try to read the stdout at all.

Closes https://github.com/mesonbuild/meson/issues/3364
2018-06-18 10:51:46 +00:00
Alex Hirsch cbe18e01e4 Deprecate `build_always`, add `build_always_stale`
Since `build_always` also adds a target to the set of default targets,
this option is marked deprecated in favour of the new option
`build_always_stale`.

`build_always_stale` *only* marks the target to be always considered out
of date, but does *not* add it to the set of default targets.

The old behaviour can still be achieved by combining
`build_always_stale` with `build_by_default`.

fixes #1942
2018-06-18 10:49:40 +00:00
Christoph Behle dbb3c05cf9 Add check for arguments of has_members.
Ensure that has_members has at least two arguments.
2018-06-18 07:52:15 +00:00
Christoph Behle 9e0397805e Use stub to report misuse of get_define
Instead of checking on the call site add a stub to Compiler which raises
an exception.
2018-06-18 07:52:15 +00:00
Christoph Behle 93b5a42ada Test if compiler supports get_define.
Raise an InterpreterError for a clean error message if get_define is not
supported by the compiler.
2018-06-18 07:52:15 +00:00
Xavier Claessens e565945253 Add UserFeatureOption type
This is a special type of option to be passed to most 'required' keyword
arguments. It adds a 3rd state to the traditional boolean value to cause
those methods to always return not-found even if the dependency could be
found.

Since integrators doesn't want enabled features to be a surprise there
is a global option "auto_features" to enable or disable all
automatic features.
2018-06-18 04:57:32 +00:00
FFY00 8ef4864ae4
dependencies: add dub as a dependency method 2018-06-17 22:34:32 +01:00
Christoph Behle 47c3a26915 Always apply concatenate_string_literal.
get_define always applies concatenate_string_literal to its result.
Remove kwarg concatenate_string_literal from get_define.
2018-06-12 00:14:54 +00:00
Christoph Behle 40d121d33e get_define can concatenate string literals.
Added method concatenate_string_literals to CCompiler. Will concatenate
  string literals.
Added keyword argument 'concatenate_string_literals' to Compiler.get_define.
  If used will apply concatenate_string_literals to its return value.
2018-06-12 00:14:54 +00:00
Nirbheek Chauhan be7d8b2d2f configure_file: Add 'encoding' to FeatureNew 2018-06-10 01:44:26 +00:00
Sander Sweers 47785bf89b Add file encoding to configure_file
Input files can be in any file encoding, not just utf-8 or isolatin1. Meson
should not make assumptions here and allow for the user to specify the
encoding to use.
2018-06-09 18:17:48 +00:00
Xavier Claessens 18e25b6773 Fix options being reset to default on reconfigure
Closes: #3712
2018-06-09 18:10:23 +00:00
Xavier Claessens 2d3bfa0778 Interpreter: Fix subdir_done() to exit from inside if/foreach blocks
Closes: #3700.
2018-06-07 12:56:27 +00:00
Xavier Claessens 7c4736d27f Convert args.projectoptions into a dict
This simplifies a lot of code, and centralize "key=value" parsing in a
single place.

Unknown command line options becomes an hard error instead of
merely printing warning message. It has been warning it would become an
hard error for a while now. This has exceptions though, any
unknown option starting with "<lang>_" or "b_" are ignored because they
depend on which languages gets added and which compiler gets selected.
Also any option for unknown subproject are ignored because they depend
on which subproject actually gets built.

Also write more command line parsing tests. "19 bad command line
options" is removed because bad cmd line option became hard error and
it's covered with new tests in "30 command line".
2018-06-06 20:02:37 +00:00
Xavier Claessens 75e501ceb8 coredata: Stop setting default option values as argparse attribute
All options are now the projectoptions list, regardless of how they got
defined in the command line.

This also delays setting builtin option values until the main project()
default options are parsed to simplify the code. This is possible
because we already delayed setting the backend after parsing main
project() in a previous commit.
2018-06-06 20:02:37 +00:00
Xavier Claessens 8fb72510c3 Move to coredata some methods handling options
Those methods only use coredata object, so better just move them as a
coredata method.
2018-06-06 20:02:37 +00:00
Xavier Claessens 5af98d16b9 Delay backend creation until project() is parsed
The project() function could have a different value for the backend
option in its default_options kwargs.

Also set backend options, passing them in command line had no effect
previously.
2018-06-06 20:02:37 +00:00
Xavier Claessens b7d442150d Move <lang>_args to coredata.compiler_options 2018-06-06 20:02:37 +00:00
Xavier Claessens fa72cd7173 Move get_args_from_envvars() from environment to compilers 2018-06-06 20:02:37 +00:00
Nirbheek Chauhan 56a7d8b2b3 Warn when Apple bitcode support is enabled and in-use
We have to disable some options, so tell the user about them and point
to the documentation so they can read more about it.
2018-06-06 07:53:10 +00:00
Jon Turney f31679dedd Fix non-list used with FeatureNewKwargs
The type of this argument needs checking, or single strings need handling correctly.
2018-06-05 15:57:57 +00:00
Nirbheek Chauhan 48d49afe31 FeatureNew: Add decorators for new install_mode kwargs 2018-06-05 15:57:57 +00:00
Nirbheek Chauhan 9b314c9c24 FeatureNew: add two features that were just merged 2018-06-05 15:57:57 +00:00
Aleksey Filippov 9e10628a69 Use mesonlib.version_compare_many() first value only as an indicator of match 2018-06-03 21:10:56 +00:00
mikolajp 2d1d6c3056 Fix meson multiple version contraint error 2018-06-03 21:10:56 +00:00
Jon Turney 7e08e958c0 Allow substitutions in custom_target() depfile:
Allow substitutions in custom_target() depfile: as well as in command:
2018-06-03 21:06:23 +00:00
Filipe Brandenburger 05c43cdcd1 Add 'install_mode' to all installable targets
This makes it possible to customize permissions of all installable
targets, such as executable(), libraries, man pages, header files and
custom or generated targets.

This is useful, for instance, to install setuid/setgid binaries, which
was hard to accomplish without access to this attribute.
2018-06-02 04:50:32 +00:00
Jussi Pakkanen bf2e21ec0e
Merge pull request #3486 from Salamandar/salamandar/meson_version_introspection
Add FeatureNew and FeatureDeprecated, to alert the user of bad meson_version
2018-06-01 22:53:06 +03:00
Mathieu Duponchelle 14750b50ea configure_file: Add output_format kwarg (#3636)
* configure_file: Add output_format kwarg

* docs: Reference-manual.md output_format was added in 0.47 [skip ci]
2018-06-01 17:53:07 +00:00
Salamandar c5e85e59cc Add 0.47.0 features 2018-06-01 14:23:24 +02:00
Salamandar 2fb6018763 Add 0.46.0 features 2018-06-01 14:23:24 +02:00
Salamandar 364b8a37b9 Add 0.45.0 features 2018-06-01 14:23:24 +02:00
Salamandar c90885de6d Add 0.44.0 features 2018-06-01 14:23:24 +02:00
Salamandar 2056172595 Add 0.43.0 features 2018-06-01 14:23:24 +02:00
Salamandar 4741f1e243 Add 0.42.0 features 2018-06-01 14:23:24 +02:00
Salamandar d5207e1c4f Add 0.41.0 features 2018-06-01 14:23:24 +02:00
Salamandar fa6550b277 Add 0.40.0 features 2018-06-01 14:23:24 +02:00
Salamandar a1a53e8de1 Add 0.38.0 features 2018-06-01 14:23:24 +02:00
Salamandar accea4889b Add 0.37.0 features 2018-06-01 14:23:24 +02:00
Salamandar 69230ce4ef print features reports after run 2018-06-01 14:23:24 +02:00
Salamandar dd91f96867 Move target_version from coredata to mesonlib 2018-06-01 14:23:24 +02:00
Salamandar ae19fec952 Add version_compare_condition_with_{min,max} for specific comparison utils.
Split FeatureNew and FeatureDeprecated
Implement features report to be printed in some 'dev mode'
2018-06-01 14:23:24 +02:00
Salamandar ee2f8a0416 Add basic code for feature version detection:
* store target version
* Add empty method decorator
2018-06-01 14:23:24 +02:00
Nirbheek Chauhan ff07314a86 New compiler method: check_header
This checks not only for existence, but also for usability of the
header, which means it does a full compilation and not just
pre-processing or __has_include.

Fixes https://github.com/mesonbuild/meson/issues/2246
2018-05-30 15:25:39 +05:30
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 320a5865d9 Mark even empty confs used appropriately. 2018-05-25 17:43:06 +03:00
Tim-Philipp Müller 8d040fad6e Print project version 2018-05-23 22:46:29 +03:00
Tim-Philipp Müller d4ee534155 interpreter: fix configure_file() message on empty configuration_data() [skip ci]
The 'copy' kwarg will appear in the upcoming 0.47 release, not 0.46.
2018-05-23 15:02:27 +00:00
Jussi Pakkanen 55a0831bc3
Merge pull request #3383 from mesonbuild/nirbheek/configure-file-nodata
configure_file: Add a new action 'copy'
2018-05-22 21:09:19 +03:00
Jussi Pakkanen 9ecd92c6fe
Merge pull request #3490 from MathieuDuponchelle/dict_builtin
Add new built-in type, dict
2018-05-22 20:46:26 +03:00
Andrei Alexeyev d72f9a3e0f
Add 'check' kwarg for run_command
Closes #3516
2018-05-22 04:45:31 +03:00
Nirbheek Chauhan f5af0f9b5a configure_file: Don't use reserved keyword 'format'
Might lead to weird bugs
2018-05-22 02:37:07 +05:30
Nirbheek Chauhan a00433fdbc configure_file: Add a new action 'copy'
This will copy the file to the build directory without trying to read
it or substitute values into it.

Also do this optimization if the configuration_data() object passed to
the `configuration:` kwarg is empty, and print a warning about it.

See also: https://github.com/mesonbuild/meson/issues/1542
2018-05-22 02:36:55 +05:30
Mathieu Duponchelle ecb8838082 Add new built-in type, dict
For now dicts are immutable, and do not expose any methods,
they however support "native" syntax such as [] lookup,
and foreach iterating, and can be printed.
2018-05-20 21:19:44 +02:00
Jon Turney 13e92223be Generalize message about fallback failure
The fallback might be not used not only because it couldn't be found, but
also because something went wrong trying to use it.

Also, update a test which relies on the specific text
2018-05-17 00:26:58 +03:00
Jon Turney 0e898def93 Improve reporting about falling back to a subproject for a dependency 2018-05-17 00:26:58 +03:00
Mathieu Duponchelle dc91aad420 args flattening: preserve configuration_data.set behaviour
It seems that some projects relied on the previously buggy
behaviour of accepting a 2-element list as the single argument
to configuration_data.set().

Special-case this behaviour, and emit a deprecation message.
2018-05-09 18:00:36 +02:00
Mathieu Duponchelle f1c92d7c9c Interpreter: don't flatten the arguments of various methods
this fixes eg set_variable('foo', ['bar', 'baz']), which
was previously erroring out complaining about the number
of arguments.

Closes #1481
2018-05-04 15:24:21 +00:00
Xavier Claessens 24f1b96dde Fix setting c_args and friends from command line
When passing more than one -Dc_args it should override the value
instead of appending. This is how all other options works.

Value should be split on spaces using shlex just like it does with
CFLAGS environment variable.

Fixes #3473.
2018-05-01 12:09:45 +00: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
Xavier Claessens 10a9bdad96 interpreter: Verify permitted kwargs on all methods 2018-04-26 00:01:48 +03:00
Nirbheek Chauhan fc5e8dfcda Don't fail on not-required not-found deps in forcefallback mode
This involves the creation of a new dummy NotFoundDependency.
2018-04-21 16:10:03 +03:00
Xavier Claessens 9a82b0136a extract_all_objects: Add 'recursive' keyword argument
To maintain backward compatibility we cannot add recursive objects by
default. Print a warning when there are recursive objects to be pulled
and the argument is not set. After a while we'll do pull recursive
objects by default.
2018-04-18 14:54:52 -04:00
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