Commit Graph

263 Commits

Author SHA1 Message Date
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
Nirbheek Chauhan 43f7a75060 gnome.gdbus_codegen: Handle XML docbook in subdirs
Closes https://github.com/mesonbuild/meson/issues/3870
2018-07-11 22:47:12 +03: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
Niclas Moeslund Overby 60b9c8300c java: implement java linking 2018-07-03 21:33:54 +02: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
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
Andrei Alexeyev f7f5e2a725 Don't let build_always take precedence over build_by_default (#3816)
* Don't let build_always take precedence over build_by_default

* Test for proper interaction of build_by_default with build_always

Fixes #3815
2018-07-01 16:55:38 +00:00
Nirbheek Chauhan 7b2a07bcf9 custom targets: Only add a dependency on absolute path external programs
If the external program is a string that is meant to be searched in
PATH, we can't add a dependency on it at configure time because we don't
know where it will be at compile time.
2018-07-01 13:59:48 +00: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
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
Jon Turney e9462ce206 Install shared_module implibs
On Windows, if we are going to link with a shared module, we need the
implib.

Use case: The Xorg server builds some X protocol extensions as modules.  The
implibs for these modules need to be shipped as part of the SDK, to enable
building of 3rd party extensions which reference symbols in (and hence on
Windows, need to be linked with) these modules.
2018-06-07 12:57:39 +00:00
Jon Turney 1f5c6d62bf More clearly explain portability issues with linking to a module
Refine #3277

According to what I read on the internet, on OSX, both MH_BUNDLE (module)
and MH_DYLIB (shared library) can be dynamically loaded using dlopen(), but
it is not possible to link against MH_BUNDLE as if they were shared
libraries.

Metion this as an issue in the documentation.

Emitting a warning, and then going on to fail during the build with
mysterious errors in symbolextractor isn't very helpful, so make attempting
this an error on OSX.

Add a test for that.

See also:
https://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm
https://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-osx
2018-06-07 12:57:39 +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
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
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
Nirbheek Chauhan 00654aeb11 Don't accept an empty string for name_suffix:
This is never going to be useful, and the error message now points
people to what they might be expecting: use the default value for this
platform.
2018-05-30 23:10:43 +03:00
Nirbheek Chauhan 8a9f7cf133 vala: Fix shared_module linking with export_dynamic executable
Need to generate a vapi and a header, and then use that in the shared
module. Needed for GNOME games.

Closes https://github.com/mesonbuild/meson/issues/3538
2018-05-10 12:31:04 +02:00
Nirbheek Chauhan 9565293f16 test setups: Inherit env when using a test setup
Closes https://github.com/mesonbuild/meson/issues/3525
2018-05-10 12:30:47 +02:00
Jussi Pakkanen 1918c0d231 Can combine D and C++ in a single target. Closes #3125. 2018-05-02 22:50:15 +03:00
Nirbheek Chauhan badbfa125c pkgconfig: Don't expose internal libraries in .pc files
Libraries that have been linked with link_whole: are internal
implementation details and should never be exposed to the outside
world in either Libs: or Libs.private:

Closes https://github.com/mesonbuild/meson/issues/3509
2018-05-02 11:46:47 +00:00
Niklas Claesson 4f4cdee687 Allow custom_target do depend on indexed output of custom_target
Fixes: #3494
2018-05-01 11:51:55 +00: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
Xavier Claessens 60aaee55d4 extract_all_objects(): Recursively extract objects
Fixes #3401
2018-04-18 14:54:52 -04:00
Xavier Claessens b0e4d4047b Fix using object extracted from a unity build
- determine_ext_objs: What matters is if extobj.target is a unity build,
  not if the target using those objects is a unity build.
- determine_ext_objs: Return one object file per compiler, taking into
  account generated sources.
- object_filename_from_source: No need to special-case unity build, it
  does the same thing in both code paths.
- check_unity_compatible: For each compiler we must extract either none
  or all its sources, taking into account generated sources.
2018-04-18 14:49:52 -04:00
Aleksey Filippov cb761718f0 Generate target id based on subdirectory instead of subproject
Allows creation of targets with same name in different subdirectories.
Closes #2861 and closes #1867
2018-04-16 22:51:34 +01:00
Jussi Pakkanen c58dd64f8e Merged Arm CC support. 2018-04-16 23:02:09 +03:00
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
Bruce Richardson 7806175c21 don't create unneeded internal dependency objects
when flattening the chained dependencies of an object, we don't need to
create any new internal dependencies if all the fields to be added to it
are empty.

For projects with a lot of libraries and dependency objects this can lead
to noticeable performance improvements.

fixup
2018-04-13 01:04:38 +00:00
Bruce Richardson c213d715eb Prune unneeded transitive dependencies
When getting dependencies, we don't need to get the same dependencies and
dependency chains multiple times. If library a depends on x, y and z, and
library b depends on a, then we should not have to iterate through x, y and
z multiple times. Pruning at the stage of scanning the dependencies leads
to significant time savings when running meson
2018-04-13 01:03:59 +00:00
Xavier Claessens 809f018333 extract_all_objects: Also extract generated sources 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
chitranjali cc6be2e43d Fixing flake8 2018-03-29 14:43:56 +05:30
chitranjali 34cb503c85 PR review changes closes #2865 2018-03-29 13:32:36 +05:30
chitranjali 83766313a7 fix2865 2018-03-29 13:26:32 +05:30
Somasekhar Penugonda e62b8109eb Updates to CPP support and update review changes 2018-03-27 17:04:26 -05:00
Sam H 3e48d47674 Squash target_type warning for jar targets 2018-03-24 01:31:48 +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
Aleksey Filippov d977b78f1b Use itertools.chain() instead of list concatenation 2018-03-11 23:36:04 +00:00
Niklas Claesson 7074bcb88a Exclude subprojects when doing coverage 2018-03-10 18:05:35 +02:00
Aleksey Filippov 077d59daa4 Add link_whole argument to declare_dependency() 2018-03-06 01:44:26 +00:00
Bedarkar, Malhar a2ee76228e First cut of ARMCC support for MESON.
Change-Id: I15d8258e84d392baaccb8f670e33eefcfe8cd49a
2018-03-05 18:26:39 -06:00
Hemmo Nieminen 7fb8e518b2 Harmonize data pickling.
Try to be more consistent on using save() and load() methods to pickle
data.
2018-03-01 01:06:51 +02:00
Aleksey Filippov 8c3a1afde0 Do not unpack link_whole target, BuildTarget.link_whole() does listify() anyway 2018-02-27 20:43:02 +02:00
Jussi Pakkanen cb176e9303 Look up compilers based on sources from deps, too. Closes #2768. 2018-02-27 20:40:41 +02:00