summaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
Commit message (Collapse)AuthorAgeFilesLines
* Scan all C++ sources and ignore everything else.Jussi Pakkanen2020-12-131-0/+4
|
* Add a variant of TemporaryDirectory that uses windows_proof_rmtree()Christoph Reiter2020-11-231-0/+20
| | | | | | | | Adds TemporaryDirectoryWinProof which calls windows_proof_rmtree() on error. Use instead of hacky error handling (which might shadow other OSError) in Compiler.compile().
* Merge pull request #8010 from dcbaker/submit/optinterpreter-cleanupsJussi Pakkanen2020-11-221-3/+7
|\ | | | | Opt Interpreter cleanups and type annotations
| * Allow setting attributes in MesonException intializerDylan Baker2020-11-201-3/+7
| | | | | | | | Instead of forcing them to be set afterwards
* | Delete now dead < python 3.6 checkDylan Baker2020-11-201-1/+1
| |
* | use real pathlib moduleDylan Baker2020-11-201-1/+1
|/ | | | | We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
* pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger2020-10-041-1/+1
|
* cmake: switch to pathlib (fixes #7322)Daniel Mensinger2020-10-041-0/+9
|
* mesonlib: make OptionOverrideProxy a true MutableMappingDylan Baker2020-10-011-21/+28
| | | | | | | So that we can actually use it anyplace that an OptionDictType could be used. I've also done a bit optimizing/simplifying of the implementation. This is needed for cuda, as it returns an OptionOverrideProxy where we ask for an OptionDicType
* compilers/compilers: Fully type annotateDylan Baker2020-09-241-0/+2
|
* pylint: turn on bad-indentation errorDylan Baker2020-09-221-1/+1
| | | | and fix all of the bad indentation
* external-project: New module to build configure/make projectsXavier Claessens2020-09-131-8/+12
| | | | | | | This adds an experimental meson module to build projects with other build systems. Closes: #4316
* git: Use Popen_safe to avoid encoding issuesXavier Claessens2020-09-101-22/+25
|
* Move verbose_git() and quiet_git() to mesonlibXavier Claessens2020-09-101-0/+16
|
* mesonlib: Move MesonException declaration to the topXavier Claessens2020-09-101-13/+11
|
* typing: Fix code reviewDaniel Mensinger2020-09-081-28/+3
|
* typing: fix code reviewDaniel Mensinger2020-09-081-16/+16
|
* typing: fix dependencies for new follow_importsDaniel Mensinger2020-09-081-1/+1
|
* typing: fully annotate mesonlib.pyDaniel Mensinger2020-09-081-40/+40
|
* Be stricter when detecting Windows/CygwinChristoph Reiter2020-08-301-2/+2
| | | | | | | | | | | | | | | | This removes the check for "mingw" for platform.system(). The only case I know where "mingw" is return is if using a msys Python under a msys2 mingw environment. This combination is not really supported by meson and will result in weird errors, so remove the check. The second change is checking sys.platform for cygwin instead of platform.system(). The former is document to return "cygwin", while the latter is not and just returns uname(). While under Cygwin it uname() always starts with "cygwin" it's not hardcoded in MSYS2 and starts with the environment name. Using sys.platform is safer here. Fixes #7552
* Merge pull request #7581 from peterh/aixJussi Pakkanen2020-08-251-0/+3
|\ | | | | Add AIX support
| * aix: fix cpu family detectionPeter Harris2020-08-121-0/+3
| | | | | | | | Like the BSDs, AIX does not return anything useful in platform.machine().
* | File: precompute hashPaolo Bonzini2020-08-181-1/+4
|/ | | | | | | | | | Most files are going to be looked up into a set or dictionary. Precompute the hash so that we only need to do so once and we can also use it to quickly weed out unequal objects. On a QEMU build, the time spent in __eq__ and __hash goes respectively from 3.110s to 2.162s and from 0.648s to 0.299s. Even larger gains are obtained by the next patch.
* Use uname -p to detect x86_64 on QNX.Elad Lahav2020-08-081-0/+2
|
* mesonlib: Add repr() methods to PerMachine classesDylan Baker2020-08-011-0/+12
| | | | Which is super helpful in debuggers
* Updated to resolve issue identifying SGI CPUs on IRIX systemsEric Dodd2020-06-101-1/+3
|
* mesonlib.py: refactored detect_vcs() to use pathlib.Path (#7230)Joshua Gawley2020-06-041-7/+11
|
* interpreter: Add always set default value for version and set it ASAPDylan Baker2020-05-141-1/+3
| | | | | | | | | | | | | | Ideally we wouldn't need to have the default dict here and could just rely on it being set as soon as project is called. There is a corner case exercised by test case common/35 run program, which is that if a FeatureNew or FeatureDeprecated is called to generate the meson version it will be unset, to work around this I've changed the type from a dict to a default dict with '' as the default value. A better fix would probably be to store all of the FeatureNew/FeatureDeprecated checks until the end, then evaluate them, but for now this results in no loss of functionality, only more functionality, even if it isn't prefect.
* boost: Try finding libraries with the matching arch (fixes #7110)Daniel Mensinger2020-05-141-0/+10
|
* Recognize Hurd as platform/OSPino Toscano2020-04-101-0/+4
|
* cmake: support cmake config file syntax (#6917)dabrain342020-04-101-13/+47
| | | | | | | | | | * cmake: enhance support of cmake config file syntax Enhance the cmakedefine support by accepting 2 or 3 tokens in the conf line as mesondefine supports strictly 2 tokens * fixup! cmake: enhance support of cmake config file syntax * fixup! fixup! cmake: enhance support of cmake config file syntax
* Remove my notes from sourcesClausKlein2020-03-191-2/+0
| | | | changes acording review comments
* Use os.path.normpath() for include pathsClausKlein2020-03-191-0/+2
| | | | | | | 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
* remove ability to pass multiple keys to extract_as_listDylan Baker2020-03-051-9/+2
| | | | | | | | 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.
* mesonlib: use mlog instead of printDylan Baker2020-03-051-2/+2
|
* mesonlib: Replace unholder argument to listifyDylan Baker2020-03-051-14/+5
| | | | | | 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.
* mesonbuild/mesonlib: Add type annotationsDylan Baker2020-03-051-120/+225
|
* mesonlib: Fix File.__eq__ to return NotImplementedDylan Baker2020-03-041-0/+2
| | | | | The implementation assumes another File, but doesn't properly guard that. Let's do that guarding.
* mesonlib: Use textwrap.dedentDylan Baker2020-03-041-4/+7
| | | | | This is mostly just to help folding editors like vim, which get confused by the non-indented code. It also helps readability, IMHO.
* types: Remove redundant __init__() -> None annotationDaniel Mensinger2020-03-021-2/+2
|
* Remove unused MesonException.get_msg_with_context()Jon Turney2020-02-281-17/+0
| | | | | After that, the only remaining user of get_error_location_string() is mlog, so move that there.
* Popen_safe: Always re-setup the console colorsNirbheek Chauhan2020-02-161-4/+9
|
* Split console colourization into a separate functionNirbheek Chauhan2020-02-161-2/+1
| | | | Use it instead of making a direct call to mlog._windows_ansi().
* 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
|