Commit Graph

213 Commits

Author SHA1 Message Date
ClausKlein 00104b1081 Remove my notes from sources
changes acording review comments
2020-03-19 19:11:10 +02:00
ClausKlein f72c990bfd Use os.path.normpath() for include paths
This make relative pathes shorter an too give a chance to
de-duplicate -isystem flags just like -I flags.

Fix common test case 203 for OSX build host too
2020-03-19 19:11:10 +02:00
Dylan Baker 581d69a8d3 remove ability to pass multiple keys to extract_as_list
This makes the typing annotations basically impossible to get right, but
if we only have one key then it's easy. Fortunately python provides
comprehensions, so we don't even need the ability to pass multiple keys,
we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and
get the same result.
2020-03-05 09:58:52 -08:00
Dylan Baker e3beaf87a5 mesonlib: use mlog instead of print 2020-03-05 09:31:29 -08:00
Dylan Baker a8293dd59c mesonlib: Replace unholder argument to listify
listify shouldn't be unholdering, it's a function to turn scalar values
into lists, or flatten lists. Having a separate function is clearer,
easier to understand, and can be run recursively if necessary.
2020-03-05 09:31:29 -08:00
Dylan Baker 1a82880730 mesonbuild/mesonlib: Add type annotations 2020-03-05 09:31:29 -08:00
Dylan Baker a7407b8782 mesonlib: Fix File.__eq__ to return NotImplemented
The implementation assumes another File, but doesn't properly guard
that. Let's do that guarding.
2020-03-04 12:30:44 -08:00
Dylan Baker f79ac4cefa mesonlib: Use textwrap.dedent
This is mostly just to help folding editors like vim, which get confused
by the non-indented code. It also helps readability, IMHO.
2020-03-04 12:29:12 -08:00
Daniel Mensinger d67888bf9b
types: Remove redundant __init__() -> None annotation 2020-03-02 10:52:59 +01:00
Jon Turney fa928e803b
Remove unused MesonException.get_msg_with_context()
After that, the only remaining user of get_error_location_string() is mlog,
so move that there.
2020-02-28 11:54:03 +00:00
Nirbheek Chauhan 97274621a5 Popen_safe: Always re-setup the console colors 2020-02-16 00:26:08 +05:30
Nirbheek Chauhan c05b725122 Split console colourization into a separate function
Use it instead of making a direct call to mlog._windows_ansi().
2020-02-16 00:26:08 +05:30
Nirbheek Chauhan 11253a1c3a mesonlib: Set stdin to DEVNULL for all programs run by us
Otherwise there's a high likelihood that some program run by us will
mess up the console settings and break ANSI colors. F.ex., running
`uname` in the Visual Studio 2019 x86 developer prompt using
`run_command()` does this.
2020-02-16 00:26:08 +05:30
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
Nirbheek Chauhan 712b2f08c7 Move git helper out into mesonlib for reuse
Reuse the git helper for `meson wrap` and `meson subprojects` so we
don't need to maintain the same git-colors-on-windows workarounds in
multiple places.
2020-01-22 17:29:38 -05:00
Daniel Mensinger cb262ab481 types: Fix/ignore flake8 B014/F811 2020-01-08 15:28:17 +01:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Michael Hirsch, Ph.D 98fd4e5557 cmake: add project language to cmakelists.txt
cmake: get language from Meson project if not specified as depedency(..., langugage: ...)

deps: add threads method:cmake

dependency('threads', method: 'cmake') is useful for cmake unit tests
or those who just want to find threads using cmake.

cmake: project(... Fortran) generally also requires C language
2019-12-09 11:15:58 -05:00
Daniel Mensinger 40837894e8 lgtm: ignore Iterator does not return self from __iter__ method 2019-12-05 11:08:12 -05: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
Michael Hirsch, Ph.D 8313e8fd54 dep: MPI make work for intel-cl and improve robustness
optimize intelMPI variables

mpi: extract version from non-OpenMPI wrapper
2019-11-25 13:08:01 +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
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
Aleksey Gurtovoy f56ef583d3 dependency('cuda') 2019-11-05 22:17:44 +02:00
Michael Hirsch, Ph.D 765a5e9835
ducking 'None' for missing module
This handles the Windows-specific case, the next commit handles the general issue
2019-10-22 23:38:32 -04:00
Zbigniew Jędrzejewski-Szmek 3a6920ebdc Add helper to print warnings once
The helper is general, although in this patch it is only used for
warnings. No functional change intended.
2019-09-25 14:52:07 +02:00
Aleksey Gurtovoy 6ac5db50c9 CUDA support on Windows 2019-09-24 14:22:20 -07:00
Alan Coopersmith 3e0279ba9f get_library_dirs: Add Solaris 64-bit library subdirs
Solaris puts 32-bit libraries in the main /lib & /usr/lib directories
and 64-bit libraries in platform specific subdirectories.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-09-13 16:13:44 -07:00
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +03:00
Thibault Saunier 42c5e4fe2b wine: Try to get the short paths when generating WINEPATH
The size of WINEPATH is limited (1024 [until recently]), we
can very easily reach that limit, and even the new one (2048) so
try to keep path as small as possible by using the shortPath
version of paths.

Also assert that we do not reach the new hard limit.

And avoid having duplicates in the list of path.

[until recently]: https://bugs.winehq.org/show_bug.cgi?id=45810
2019-08-24 06:43:47 -04:00
nia 246b49fe75 Support NetBSD aarch64 and earm. 2019-08-23 13:10:25 -07:00
Jussi Pakkanen a201499306 Only iterate over existing libdirs. 2019-08-17 13:14:05 +03:00
Dylan Baker 753587ee15 mesonlib: Annotate Popen_safe functions
These are used in linkers.py and need to be annotated to make linkers.py
100% clean
2019-07-23 09:58:24 +00:00
Nirbheek Chauhan 9c2724bce5 Add optional progress bar when generating build.ninja 2019-07-20 17:02:15 +03:00
Michael Hirsch, Ph.D 8e0acae439
type hints @dcbaker 2019-07-08 22:28:24 -04:00
Michael Hirsch, Ph.D c756d06fbb
add clang c_std=c18 alias
fix unit test skips for clang c18

correct unittests clang minimum version

cleanup unittest clang skip c_std

finesse unittest vs. clang version
2019-07-08 22:27:35 -04:00
John Ericson 8a09434cd4 remove `for_XXX` functions from mesonlib
All uses now use `env.machines.YYY.is_XXX` instead.
2019-06-09 13:13:31 -04:00
John Ericson 32e827dcdc Use `env.machines.*` to avoid some `is_cross`
This is a small example of the `is_cross` removal the that abstraction
enables.
2019-06-09 13:13:20 -04:00
John Ericson af2d7af998 Per machine do 'build.' and '' option prefixes
See the docs/ changes for details.
2019-06-05 23:05:34 -04:00
Michael Hirsch, Ph.D e83084fbfe BUGFIX variable name #5285
handle x86 correctly
2019-05-28 21:55:54 +03:00
Jussi Pakkanen 67a5af99aa
Merge pull request #5395 from dcbaker/mtest-annotations
Mtest annotations and bug fixes
2019-05-16 00:31:01 +03:00
John Ericson 957d8e051c Make `PerMachine` and `MachineChoice` have just `build` and `host`
Meson itself *almost* only cares about the build and host platforms. The
exception is it takes a `target_machine` in the cross file and exposes
it to the user; but it doesn't do anything else with it. It's therefore
overkill to put target in `PerMachine` and `MachineChoice`. Instead, we
make a `PerThreeMachine` only for the machine infos.

Additionally fix a few other things that were bugging me in the process:

 - Get rid of `MachineInfos` class. Since `envconfig.py` was created, it
   has no methods that couldn't just got on `PerMachine`

 - Make `default_missing` and `miss_defaulting` work functionally. That
   means we can just locally bind rather than bind as class vars the
   "unfrozen" configuration. This helps prevent bugs where one forgets
   to freeze a configuration.
2019-05-16 00:27:57 +03:00
Dylan Baker 2cc70c631b mesonlib: Annotate substring_in_list
for mtest
2019-05-14 16:43:29 -07:00
Simon Ney 81170a9cbe This is the fork "sneyx1234/meson" of the current git "mesonbuild/meson" head to converge it to the solaris 11.4 platform based on the sparcv9 and i386 processor architecture.
The purpose is to complete the porting related to the fork "sneyx1234/ast" of "att/ast" the "AT&T kornshell".
2019-05-13 02:42:56 +03:00
Dylan Baker edb1229a48 mesonlib: Make a few type annotations strings
Mypy know what to do with these and isn't confused, but some versions of
python 3.5 (at least 3.5.2) can't handle these annotations. By making
them strings the python interpreter wont try to evaluate them.

Fixes #5326
2019-05-02 23:38:36 +03:00
Jussi Pakkanen 1f4023fa47
Merge pull request #5311 from mensinda/flake8Plugins
Added flake8 plugins and some code fixes
2019-05-02 23:30:29 +03:00
John Ericson 4c2617a9c6 Add some type annotations and fix lints
Some things, like `method[...](...)` or `x: ... = ...` python 3.5
doesn't support, so I made a comment instead with the intention that it
can someday be made into a real annotation.
2019-05-02 10:58:23 -07:00
Michael Olbrich a15a8b7e24 Don't close fds when executing programs
This is basically the same as #1612 just for new new Popen_safe_legacy().
2019-05-01 21:28:29 +03:00
Daniel Mensinger e75211d321
Fix builtin variable names 2019-04-29 12:17:40 +02:00
Jussi Pakkanen 60969d99d3
Merge pull request #5265 from dcbaker/more-annotations
Fully annotate the envconfig and mlog modules
2019-04-28 20:20:25 +03:00