Commit Graph

304 Commits

Author SHA1 Message Date
Olexa Bilaniuk ad442b3520 Add cuda_args keyword. 2019-01-31 04:26:37 -05:00
Nicolas Schneider 1058430898 raise an error if PCH files are stored in different folders 2019-01-29 22:04:35 +02:00
Luca Boccassi 267792174c custom_target: do not let install override build_by_default
A custom_target, if install is set to true, will always be built by
default even if build_by_default is explicitly set to false.
Ensure that this does not happen if it's set explicitly. To keep
backward compatibility, if build_by_default is not set explicitly and
install is true, set build_by_default to true.

Fixes #4107
2019-01-17 20:40:19 +02:00
John Ericson b53c982b58 Build class should not duplicate compiler state
Compilers should be held by coredata, so this is just here for
convenience.
2019-01-14 00:16:36 +02:00
Daniel Mensinger 3588786138
Some small fixes 2019-01-06 12:19:31 +01:00
Daniel Mensinger 5c39dd0668
Doc updates and throw if no target type is set 2019-01-06 12:19:31 +01:00
Daniel Mensinger b034f52656
Filenames are now lists 2019-01-06 12:19:29 +01:00
Daniel Mensinger c4eb5c79fe
Added unit test 2019-01-06 12:19:28 +01:00
Daniel Mensinger a5be893b19
Some code cleanup 2019-01-06 12:19:28 +01:00
Nicolas Schneider 31e1a31030 fail configuration if PCH files do not exist
Previously, the configuration worked fine, but the compiler raised an
error. Now, we explicitly check for the existence of files and print a
useful error message if they do not exist.
2019-01-01 19:36:37 +02:00
Jussi Pakkanen d64f93800f Do not write cp entry when it is empty. Closes #4602. 2018-12-09 16:24:37 +02:00
Xavier Claessens 377719cc7b BuildTarget: Fix typo, self.install does not exists 2018-12-04 06:49:02 -05:00
John Ericson 0fd548e16f Combine `run_tests` import lines in `run_unittests` 2018-12-03 22:33:20 +02:00
Aleksey Filippov 1c8c888854 Use first 7 letters of sha256 for subdirectory part of target id
Fixed-size hash makes paths shorter and prevents doubling of path length
because of subdir usage in target id: "subdir/id" would generate
"subdir/{subdir-without-slashes}@@id" target otherwise.

Export construct_id_from_path() to aid tests.
Add a separate unit test for this function to make sure it is not broken unexpectedly.

Closes #4226.
2018-11-22 23:38:40 +02:00
Stian Selnes 0821462ce3 Add kwarg is_default to add_test_setup()
is_default may be used to set the name of the test setup that will be
used by default whenever the option --setup is not given.

Fixes #4430
2018-11-12 16:23:59 +05:30
Jussi Pakkanen 59774702b2
Merge pull request #4480 from jon-turney/fix-implib-prefix-suffix
Fix naming of implib when name_prefix/suffix is used
2018-11-10 23:40:24 +02:00
Phillip Cao 68c83cb213 Add support for Renesas CC-RX toolchain 2018-11-08 00:02:22 +13:00
Jon Turney e64a9c9830
Generate import lib even if both name_suffix and name_prefix are used
It's a (presumably unintentional) quirk of the current implementation of
SharedLibrary.determine_filenames() that if both name_suffix and
name_prefix are set, an import library isn't generated.

Adjust test 'common/25 library versions': Make the library have exports,
so an implib is generated with MSVC. Add implib to set of files expected
to be installed

Adjust test 'common/122 shared module': Add libnosyms implib to set of
files expected to be installed, except for MSVC, where none is generated
as it has no exports
2018-11-06 13:17:21 +00:00
Jon Turney 7a959ffbba
Fix library implib name when name_prefix: is used
Use the specified name_prefix for implib, rather than hardcoding it.

(This is needed to allow an installed library given name_prefix:'' and a
name starting with 'lib' to be linked with using -l. (This case is
handled specially in the pkgconfig module))
2018-11-06 12:52:02 +00:00
Jon Turney 64edfd5069
Detect clang-cl as msvc-like, not clang-like
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX

Future work: checking the name of the executable here seems like a bad idea.
These compilers will fail to be detected if they are renamed.

v2:
Update compiler.get_argument_type() test
Fix comparisons of id inside CCompiler, backends and elsewhere

v3:
ClangClCPPCompiler should be a subclass of ClangClCCompier, as well

Future work: mocking in test_find_library_patterns() is effected, as we
now test for a subclass, rather than self.id in CCompiler.get_library_naming()
2018-11-04 15:42:00 +00:00
Xavier Claessens edccb11f01 Rollback if an optional subproject fails
If a subproject is not required and fails during its configuration, the
parent project continues, but should not include any target or state set
by the failed subproject. This fix ninja still trying to build targets
generated by subprojects before they fail in their configuration.

The 'build' object is now per-interpreter instead of being global. Once
a subproject interpreter succeed, values from its 'build' object are
merged back into its parent 'build' object.
2018-10-29 20:22:33 +02:00
Xavier Claessens c453400d59 Add 'b_pie' compiler option
On Android executables must be position independent, many
distributions enable it by default too for security reasons.
2018-10-20 00:47:27 +03:00
Jussi Pakkanen 88054c48a6
Merge pull request #4293 from marcelhollerbach/master
Performance optimize the install part generation
2018-10-04 22:10:09 +03:00
Marcel Hollerbach c53d35aa72 build: generate the mappings in the Targets
Before, the mappings has been created over all the links, while it
actaully only used the Shared or Static Targets. This structure now is
tree like structured and cached, thus the results can be computed a lot
faster.
The generator step generate_install is now for EFL from 6 sec. down to
0.3s. Which improves the overall build time from ~20 sec. to ~14 sec.
2018-10-01 23:47:19 +02:00
Marcel Hollerbach c38544a6ec build: move default_install_dir to the Target classes
there is a huge amount of isinstance calls, this reduces the amount of
these calls while splitting up a rather big function. It also assosiates
every target type with theire default install directory.
2018-10-01 23:47:19 +02:00
GoaLitiuM 8776dac773 Add conditional debug identifiers for D compilers, and enable for debug builds
Also includes parsing the highest integer level for debug and version.
2018-09-27 17:49:48 +03:00
Jussi Pakkanen b6f03f897b
Merge pull request #4174 from jon-turney/link-with-custom-target
Improve error when trying to link_with a custom_target
2018-09-17 22:49:01 +03:00
Jon Turney b338add554 Fix flake8 whitespace reports
$ flake8 | grep -E '(E203|E221|E226|E303|W291|W293)'
./mesonbuild/build.py:964:5: E303 too many blank lines (2)
./tools/dircondenser.py:70:36: E221 multiple spaces before operator
2018-09-13 20:33:17 +03:00
Jon Turney 44a340a4fe
Move default is_linkable_target method up from BuildTarget to Target
BuildTarget.link() assumes that it can call is_linkable_target() on any
objects which are a subclass of Target
2018-09-13 17:02:43 +01:00
Marcel Hollerbach 7ae3fbf88d mesonbuild: move subdir generation along link dep generation
The problem with the earlier position of the generation code was, that
the results could not be cached, because the list of all link_deps was
overall different. However, it shared a special kind of subsets with
other build build targets.

Generating the set of subdirs that are required for linking, alongside
with the link dependencies brings the possibility of caching this.
This reduces the buildting from 1 min. in efl down to 20 sec. And
reduces the amount of 30872534 calls down.

this saves ~40 sec.
2018-09-11 03:03:30 -07:00
Marcel Hollerbach be1003a8e9 build: try to cache the result of the link deps
this safes in the efl meson build about 20 sec.
2018-09-11 03:03:30 -07:00
Rafael Ávila de Espíndola 07d2d88fa9 Allow override_find_program to use an executable.
With this it is now possible to do

foobar = executable('foobar', ...)
meson.override_find_program('foobar', foobar)

Which is convenient for a project like protobuf which produces both a
dependency and a tool. If protobuf is updated to use
override_find_program, it can be used as

protobuf_dep = dependency('protobuf', version : '>=3.3.1',
                          fallback : ['protobuf', 'protobuf_dep'])
protoc_prog = find_program('protoc')
2018-09-03 21:24:01 +03:00
Nirbheek Chauhan bead8287a5 Improve support for macOS dylib versioning
We now use the soversion to set compatibility_version and
current_version by default. This is the only sane thing we can do by
default because of the restrictions on the values that can be used for
compatibility and current version.

Users can override this value with the `darwin_versions:` kwarg, which
can be a single value or a two-element list of values. The first one
is the compatibility version and the second is the current version.

Fixes https://github.com/mesonbuild/meson/issues/3555
Fixes https://github.com/mesonbuild/meson/issues/1451
2018-08-29 15:51:23 -07:00
Jussi Pakkanen b86f2fd17f
Merge pull request #4016 from thiblahute/hotdoc
modules: Add an 'hotdoc' module
2018-08-29 21:18:26 +03:00
Thibault Saunier 378bd4df0e modules: Add an 'hotdoc' module
hotdoc: http://github.com/hotdoc/hotdoc/
2018-08-28 18:18:40 -03:00
Jussi Pakkanen fb770e1e3d Add support for custom dist scripts. 2018-08-27 23:35:29 +03:00
Jussi Pakkanen 1ffc8de5e8
Merge pull request #3981 from GoaLitiuM/d-win-fixes
Fix D support on Windows
2018-08-27 22:30:23 +03:00
Jussi Pakkanen 54aed1a92c Added "native" kwarg to add_XXX_args. Closes #3669. 2018-08-22 23:22:48 +03:00
GoaLitiuM 4a1d64cb6c Fix import libraries and static library naming 2018-08-20 22:27:31 +03:00
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 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