Commit Graph

789 Commits

Author SHA1 Message Date
Gerion Entrup b1304f7290 version parsing: match only when version starts with a number
This leads to better version parsing. An concrete example use case is
llc. When invoking llc with "--version", the output is
```
LLVM (http://llvm.org/):
  LLVM version 9.0.1
  ...
```
The old version parsing recognizes the dot in the first line as version.

This commit also tries to adapt the two regexes to each other.

Reported-by: Björn Fiedler <fiedler@sra.uni-hannover.de>
2020-02-17 01:10:40 +05:30
Nirbheek Chauhan 1e4eeccb0f configure_file: Also copy timestamps to avoid useless rebuilds
If we always copy files over without timestamps, we're forcing
a (probably unnecessary) rebuild. Also include a test for this.
2020-02-11 10:00:40 -05:00
Xavier Claessens 3ba0073df6 Make 'default_library' per-subproject builtin option
Currently it's just like if all builtin/base/compiler options are
yielding. This patch makes possible to have non-yielding builtin
options. The value in is overriden in this order:
 - Value from parent project
 - Value from subproject's default_options if set
 - Value from subproject() default_options if set
 - Value from command line if set
2020-02-06 14:11:24 -05:00
Michael Hirsch, Ph.D a4e4d2e75a
doc 2020-02-05 13:26:35 -05:00
Michael Hirsch, Ph.D 554d35c3f3
add get_external_property to replace get_cross_property 2020-02-05 13:23:55 -05:00
Michael Hirsch, Ph.D c2e6565029
add meson.get_native_property for native files
This allows Meson native-file [properties] to be used.
This avoids the need to call meson from a script file or have a
long command line invocation of `meson setup`

The method meson.get_native_property('prop', 'fallback') is added.
The native file can contain properties like

```
[properties]
myprop1 = 'foo'
mydir2 = 'lib/custom'
```

Then from within `meson.build`

```meson
x1 = meson.get_native_property('myprop1')

thedir = meson.get_native_property('mydir2', 'libs')
```

fallback values are optional
2020-02-05 13:23:55 -05:00
Xavier Claessens 15eb0014ac interpreter: Iterate custom target outputs 2020-02-04 21:28:32 +02:00
Xavier Claessens 31f00c11d3 summary: Fix empty list case
Fixes: #6557.
2020-02-01 11:21:16 +01:00
Daniel Mensinger d0c7b51693 mintro: use interpreter data for buildsystem-files (fixes #6390) 2020-01-28 21:18:25 +02:00
Daniel Mensinger 668610c0d2 backend: refactor: set self.interpreter in the constructor 2020-01-28 21:18:25 +02:00
Jussi Pakkanen a51c9af921
Merge pull request #6423 from dcbaker/declare-dependency-variables
Add ability to set and query arbitrary variables on declare_dependency objects
2020-01-27 18:29:22 +02:00
Xavier Claessens b74ece344f Support multiple args to message() and warning() 2020-01-26 07:51:16 -05:00
Xavier Claessens f54f27b1a8 Fix required dependency() not failing when wrap-mode=nofallback
When a dependency is required, not found on the system, and its fallback
is disabled with --wrap-mode=nofallback, meson should abort instead of
returning not-found.
2020-01-25 08:51:46 -05:00
Xavier Claessens 61993f893b Fix typo in error message 2020-01-18 11:23:46 -05:00
Dylan Baker cd895be99a dependencies: Add ability to set arbitrary variables on
declare_dependencies

This allows dependencies declared in subprojects to set variables, and
for those variables to be accessed via the get_variable method, just
like those from pkg-config and cmake. This makes it easier to use
projects from subprojects in a polymorphic manner, lowering the
distinction between a subproject and an external dependency every
further.
2020-01-09 11:02:17 -08:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Xavier Claessens e5297aeca5 summary: Change 'section' to be a kwarg instead of positional
Fixes: #6372.
2019-12-19 14:19:39 -05:00
Michael Hirsch, Ph.D 5695dc0f16 add compiler.get_linker_id() method
this can be useful for if/elif where linker behaviors must be
considered.

For example, clang with "link" vs gcc with "ld.bfd" etc.

ci for compiler.get_linker_id() method

doc

add @FeatureNew check

Co-Authored-By: Daniel Mensinger <daniel@mensinger-ka.de>
2019-12-19 12:03:55 -05:00
Daniel Mensinger c4649704c8 python: add embed to the python dependency function 2019-12-18 01:19:16 +02:00
Xavier Claessens a4bb0928e3 summary: Add 'Subprojects' section to main project 2019-12-12 18:30:17 -05:00
Xavier Claessens 38953d8ee3 summary: Add bool_yn keyword argument 2019-12-12 18:30:17 -05:00
Xavier Claessens 49082f9669 summary: Allow section with no title, and passing key/value separately 2019-12-12 18:30:17 -05:00
Xavier Claessens 6e865a2330 Add a summary() function for configuration summarization
Based on patch from Dylan Baker.

Fixes #757
2019-12-12 18:30:17 -05:00
Xavier Claessens 552e78da4d assert(): Make message argument optional 2019-12-10 18:02:41 +02:00
Xavier Claessens 162d2bcc71 run_command: Do not add dependency on /dev/stdout
Blacklist /dev paths, this fix infinite reconfigure when /dev/stdout is
redirected to a file.

Fixes: #6315.
2019-12-09 18:05:18 +02:00
Xavier Claessens b872099468 find_program(): Add 'dirs' keyword argument
Fixes: #1576
2019-12-05 16:52:22 -05:00
Xavier Claessens 691a74aec2 interpreter: Remove useless check
extract_required_kwarg() above already ensure that required is always
boolean at that point.
2019-12-05 16:52:22 -05:00
Daniel Mensinger f1971fed90 lgtm: Actually supress the Non-standard exception warning 2019-12-05 11:08:12 -05:00
Daniel Mensinger 454e323d3d lgtm: ignore Non-standard exception raised in special method 2019-12-05 00:22:10 +02:00
Xavier Claessens b33830f99e Revert "Have set() and set_quoted() of configuration object work with newlines."
This reverts commit 6ed36e97ae.
2019-11-28 14:32:56 -05:00
Xavier Claessens 80dd3e30ce Fix crash when checking multi version on subproject dep
Also harminize a bit the logged message.
2019-11-26 11:31:48 -05:00
Xavier Claessens f0565e6dc8 Simplify list of build def files
Refactor the code inside a common function for consistency.

It's not needed to add dependencies in func_configure_file() because
it's already done in run_command_impl(). Do it only for files from
`input:` in the case some of them does not end up in the command
arguments.
2019-11-25 22:35:34 +02:00
Jussi Pakkanen 5920344b92
Merge pull request #6199 from mensinda/cmSysInc
cmake: Handle CMake system include dirs (closes #6079)
2019-11-20 18:41:18 +02:00
Jehan 6ed36e97ae Have set() and set_quoted() of configuration object work with newlines.
* Have set() and set_quoted() of configuration object work with newlines.

set_quoted() makes the value into a double-quoted string, so let's
assume C-style string, in particular with newlines as "\n".

Also take care of remaining newlines in dump_conf_header(). C or nasm
macros expect single-line values so if the value was multi-line, we
would end up with broken syntax. Appending a backslash at each end of
line make them concat into a single line in both C and nasm format
(note: multi-line macros in nasm are actually possible apparently but
use another format not outputted by current meson code). Also note that
the replacement is done at the end only when dumping the conf as a
header because we cannot assume anything about the format when replacing
variables from an input file (in this case, it should be the dev
responsibility).

* Add unit tests for multiline set() and set_quoted().
2019-11-19 21:05:54 +02:00
Eric Le Bihan 24cdb4a92f Interpreter: display linker executable path, if available
Instead of only displaying the identifier of the linker, display also the path
to the executable in order to report useful information when cross-compiling.
2019-11-19 16:32:12 +02:00
Daniel Mensinger 9435f11b17
ci: Add CI command to include text files in the CI log 2019-11-19 15:21:13 +01:00
Jussi Pakkanen bf800101c2
Merge pull request #6182 from mensinda/depInfo
Better dependency logs
2019-11-17 14:29:47 +02:00
Jehan c6f93b6bf6 Issue #6174: run_command() with compiler object behind ccache fails.
When run_command() first parameter is a compiler object, keep additional
exelist values as arguments.
2019-11-17 00:38:23 +02:00
Daniel Mensinger 2e62d6a203
Highlight '(cached)' and add color to the dependency version 2019-11-14 17:19:42 +01:00
Daniel Mensinger f8ba76cc22
dependencies: Print version of cached dependencies 2019-11-14 17:15:59 +01:00
Jussi Pakkanen 35e809fc5e Store run target names in build.
This way we can easily check that we only provide builtin targets such
as clang-format if the user has not provided their own.
2019-11-10 23:45:42 +02:00
Zbigniew Jędrzejewski-Szmek 74151ead9a Make the hint about built-in options more useful
In a large project, it can be hard to guess what meson "had in mind", when many different
warnings are added in different places. Let's make the message precise and specify the location.

WARNING: Consider using the built-in warning_level option instead of adding warning flags by hand.
↓
meson.build:414: WARNING: Consider using the built-in warning_level option instead of using "-Wextra".
2019-11-08 23:21:49 +02:00
Zbigniew Jędrzejewski-Szmek d55aaa56f4 "built-in" is the standard spellling 2019-11-08 23:21:49 +02:00
Jussi Pakkanen 46788d1b5b Created the filesystem module. 2019-11-08 00:44:45 +02:00
Wolfgang Stöggl f037e7ef45 Fix typos found by codespell
- Typos were found by codespell v1.16.0
2019-11-06 09:55:30 -05:00
Michael Hirsch, Ph.D 4857940e89
raise exception when a non-required module not found and subsequently used 2019-10-22 23:38:39 -04:00
Michael Hirsch, Ph.D ebb1ad528a path interpreter--silently discard invalid Unix relative paths on Windows
fixes #6000

The idea is that end-users want to specify an array of directories to search by default
without an if/elif stack. It's obvious that Unix absolute paths are not absolute on
Windows, so silently discard Unix absolute paths here for Windows instead of raising
exception.
2019-10-11 10:08:00 -07:00
Jussi Pakkanen 51fef880b6
Merge pull request #5953 from mensinda/isystem
Add is_system to dependency
2019-10-06 17:33:12 +03:00
Daniel Mensinger 73d52266b5
Use include_type instead of is_system 2019-10-03 10:06:04 +02:00
Daniel Mensinger e5c720ff60
Move generate_system_dependency to Dependency 2019-10-03 10:06:04 +02:00