summaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
Commit message (Collapse)AuthorAgeFilesLines
...
* mesonlib: Set stdin to DEVNULL for all programs run by usNirbheek Chauhan2020-02-161-0/+4
| | | | | | | 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.
* add meson.get_native_property for native filesMichael Hirsch, Ph.D2020-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move git helper out into mesonlib for reuseNirbheek Chauhan2020-01-221-0/+14
| | | | | | 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.
* types: Fix/ignore flake8 B014/F811Daniel Mensinger2020-01-081-2/+2
|
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-33/+33
|
* cmake: add project language to cmakelists.txtMichael Hirsch, Ph.D2019-12-091-1/+3
| | | | | | | | | | | 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
* lgtm: ignore Iterator does not return self from __iter__ methodDaniel Mensinger2019-12-051-2/+8
|
* Revert "Have set() and set_quoted() of configuration object work with newlines."Xavier Claessens2019-11-281-2/+0
| | | | This reverts commit 6ed36e97aeb01dd779115a9710d3a97cdbcb4ccf.
* dep: MPI make work for intel-cl and improve robustnessMichael Hirsch, Ph.D2019-11-251-1/+1
| | | | | | optimize intelMPI variables mpi: extract version from non-OpenMPI wrapper
* Have set() and set_quoted() of configuration object work with newlines.Jehan2019-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | * 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().
* Fix typos found by codespellWolfgang Stöggl2019-11-061-4/+4
| | | | - Typos were found by codespell v1.16.0
* dependency('cuda')Aleksey Gurtovoy2019-11-051-0/+7
|
* ducking 'None' for missing moduleMichael Hirsch, Ph.D2019-10-221-2/+2
| | | | This handles the Windows-specific case, the next commit handles the general issue
* Add helper to print warnings onceZbigniew Jędrzejewski-Szmek2019-09-251-1/+14
| | | | | The helper is general, although in this patch it is only used for warnings. No functional change intended.
* CUDA support on WindowsAleksey Gurtovoy2019-09-241-0/+30
|
* get_library_dirs: Add Solaris 64-bit library subdirsAlan Coopersmith2019-09-131-0/+8
| | | | | | | 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>
* mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy2019-09-051-1/+79
|
* wine: Try to get the short paths when generating WINEPATHThibault Saunier2019-08-241-0/+34
| | | | | | | | | | | | | 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
* Support NetBSD aarch64 and earm.nia2019-08-231-0/+3
|
* Only iterate over existing libdirs.Jussi Pakkanen2019-08-171-2/+6
|
* mesonlib: Annotate Popen_safe functionsDylan Baker2019-07-231-4/+11
| | | | | These are used in linkers.py and need to be annotated to make linkers.py 100% clean
* Add optional progress bar when generating build.ninjaNirbheek Chauhan2019-07-201-0/+55
|
* type hints @dcbakerMichael Hirsch, Ph.D2019-07-081-6/+5
|
* add clang c_std=c18 aliasMichael Hirsch, Ph.D2019-07-081-3/+3
| | | | | | | | | | fix unit test skips for clang c18 correct unittests clang minimum version cleanup unittest clang skip c_std finesse unittest vs. clang version
* remove `for_XXX` functions from mesonlibJohn Ericson2019-06-091-70/+0
| | | | All uses now use `env.machines.YYY.is_XXX` instead.
* Use `env.machines.*` to avoid some `is_cross`John Ericson2019-06-091-39/+21
| | | | | This is a small example of the `is_cross` removal the that abstraction enables.
* Per machine do 'build.' and '' option prefixesJohn Ericson2019-06-051-5/+7
| | | | See the docs/ changes for details.
* BUGFIX variable name #5285Michael Hirsch, Ph.D2019-05-281-2/+4
| | | | handle x86 correctly
* Merge pull request #5395 from dcbaker/mtest-annotationsJussi Pakkanen2019-05-161-1/+1
|\ | | | | Mtest annotations and bug fixes
| * mesonlib: Annotate substring_in_listDylan Baker2019-05-141-1/+1
| | | | | | | | for mtest
* | Make `PerMachine` and `MachineChoice` have just `build` and `host`John Ericson2019-05-161-7/+90
|/ | | | | | | | | | | | | | | | | | 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.
* This is the fork "sneyx1234/meson" of the current git "mesonbuild/meson" ↵Simon Ney2019-05-131-0/+3
| | | | | | 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".
* mesonlib: Make a few type annotations stringsDylan Baker2019-05-021-1/+2
| | | | | | | | 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
* Merge pull request #5311 from mensinda/flake8PluginsJussi Pakkanen2019-05-021-8/+8
|\ | | | | Added flake8 plugins and some code fixes
| * Fix builtin variable namesDaniel Mensinger2019-04-291-8/+8
| |
* | Add some type annotations and fix lintsJohn Ericson2019-05-021-5/+3
| | | | | | | | | | | | 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.
* | Don't close fds when executing programsMichael Olbrich2019-05-011-1/+1
|/ | | | This is basically the same as #1612 just for new new Popen_safe_legacy().
* Merge pull request #5265 from dcbaker/more-annotationsJussi Pakkanen2019-04-281-9/+21
|\ | | | | Fully annotate the envconfig and mlog modules
| * mesonlib: Add some type annotationsDylan Baker2019-04-221-9/+21
| | | | | | | | Just enough to make mlog and envconfig happy
* | mesonlib: Reimplement version comparison for speedDylan Baker2019-04-251-14/+25
| |
* | mesonlib: Remove useless repetition of the same checkDylan Baker2019-04-251-10/+1
| | | | | | | | due to refactoring this is now useless.
* | mesonlib: specialize the implementation of == and !=Dylan Baker2019-04-251-1/+8
| | | | | | | | | | | | Instead of using the ___cmp__ method just straight up compare the two values, since we've already converted numbers to ints and split non-numeric seperators this is sufficient, and 4x faster
* | mesonlib: use ints instead of strings for numbersDylan Baker2019-04-251-6/+7
| | | | | | | | makes version comparisons even faster
* | mesonlib: use zip() in VersionDylan Baker2019-04-251-6/+6
|/ | | | | Instead of range. This makes version comparison 25-50% faster depending on the operator and how different the values are.
* replace library type strings with an enumDylan Baker2019-03-201-0/+10
| | | | | | | This patch creates an enum for selecting libtype as static, shared, prefer-static, or prefer-shared. This also renames 'static-shared' with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is just a refactor with no behavioral changes or user facing changes.
* Fix get_library_dirs() on FreeBSDNiclas Zeising2019-02-201-0/+2
| | | | | | | | Fix get_library_dirs() on FreeBSD to only return /usr/local/lib, /usr/lib and /lib as the default location to look for libraries. FreeBSD does not use lib/${platform} or lib64 by default. In general, those directories should not exist, but in case they do, ensure they're not picked up.
* Fix default_libdir() on FreeBSDNiclas Zeising2019-02-201-0/+2
| | | | | | | | Fix defaul_libdir() on FreeBSD. The current behaviour of using usr/lib64 if that exists is wrong on FreeBSD. The default should be to always use usr/lib, even if usr/lib64 exists as a folder in the file system. Fix this by checking if we're running on FreeBSD and then always return 'lib' in default_libdir().
* add type hintingMichael Hirsch, Ph.D2019-02-131-44/+45
| | | | | | | | | | more type hints syntax modernization / robustify syntax typo more effective directory collection
* mesonlib: Use class syntax for defining MachineChoiceDylan Baker2019-02-111-1/+9
| | | | | | Mypy struggles with the imperative form of Enum declaration, and upstream doesn't consider it a bug, they recomend using the class form for enums that are going to be externally exposed.
* macos: lipo outputs aarch64 as arm64, fix itNirbheek Chauhan2019-02-011-0/+1
| | | | Or we'll reject arm64 objects as invalid when building for aarch64