summaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #2840 from alyst/fix_detect_locationJussi Pakkanen2018-01-071-18/+29
|\ \ | |/ |/| Fix meson location detection from other meson tools
| * normpath to bundled meson executableAlexey Stukalov2018-01-031-1/+5
| | | | | | | | add comments clarifying when the 1st method of finding meson.py may fail
| * fix meson location detection if run by wraptoolAlexey Stukalov2018-01-031-16/+23
| | | | | | | | | | | | | | | | teach detect_meson_py_location() that meson.py is not the only one meson executable (there's wraptool + legacy scripts) that could be installed to the PATH folder fixes #2810
* | Bump minimum supported Python from 3.4 to 3.5.Jussi Pakkanen2018-01-041-25/+0
| |
* | Add missing for_linux( ) function.Benjamin Redelings2018-01-011-0/+12
|/
* Dead code removal.promotedepJussi Pakkanen2017-12-211-9/+0
|
* Also promote wrap files.Jussi Pakkanen2017-12-171-6/+11
|
* Print instructions on how to promote subsubprojects.Jussi Pakkanen2017-12-171-0/+29
|
* Print UTF-8 warning only when actually encountering non-ascii filenames.Jussi Pakkanen2017-12-141-0/+29
|
* haiku: do not add pthread argumentsDylan Baker2017-12-071-0/+12
| | | | | Haiku has pthreads, but they are part of the standard C library, and do not need either special compiler or linker flags.
* Merge pull request #2638 from jibsen/use-value-regexJussi Pakkanen2017-12-031-5/+4
|\ | | | | Use regex to substitute template strings
| * Use regex to substitute template stringsJoergen Ibsen2017-11-221-5/+4
| |
* | configure_file: Compare difference in binary modeNirbheek Chauhan2017-11-271-1/+1
| | | | | | | | | | | | Otherwise Python will try to use string decode on the configured file and fail if it contains characters that can't be mapped to the current encoding.
* | Fix running tests when there is a period in PATH.Jussi Pakkanen2017-11-271-1/+7
| |
* | Improve escaping in configuration filesJoergen Ibsen2017-11-261-13/+22
| | | | | | | | | | Replace pairs of backslashes before '@' or '\@' with singles (allows escaping the escape character). Do not consume next '@' after '\@'.
* | Try harder to find meson.py. Closes #2672.Jussi Pakkanen2017-11-231-1/+23
|/
* Merge pull request #2498 from mesonbuild/runpythonJussi Pakkanen2017-11-221-0/+9
|\ | | | | Add possibility to run Python scripts with current interpreter
| * Review fixes.Jussi Pakkanen2017-11-211-2/+2
| |
| * Changed code to use detected executables rather than hardcoding sys.executable.Jussi Pakkanen2017-11-201-0/+9
| |
* | Use re.sub instead of replace loopJoergen Ibsen2017-11-221-6/+5
|/ | | | This also prohibits recursive substitution.
* compilers: Improve manual library searchingNirbheek Chauhan2017-11-111-0/+36
| | | | | | We can now specify the library type we want to search for, and whether we want to prefer static libraries over shared ones or the other way around. This functionality is not exposed to build files yet.
* Use listify and extract_as_list everywhereNirbheek Chauhan2017-10-011-26/+25
| | | | | | They now flatten by default and unhold objects if required Includes unit tests.
* Always flatten in listify() since we always want thatNirbheek Chauhan2017-10-011-16/+18
| | | | | | All our kwargs take lists that must be flattened Closes https://github.com/mesonbuild/meson/issues/2408
* Merge pull request #2331 from mesonbuild/winencodeJussi Pakkanen2017-09-191-0/+22
|\ | | | | Do not use universal newlines on old Python versions.
| * Do not use universal newlines on old Python versions.Jussi Pakkanen2017-09-181-0/+22
| |
* | Gnome, pkgconfig, Qt4, Qt5 and windows modules slightly refactored.Alexis Jeandet2017-09-181-1/+3
| | | | | | | | Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
* | Introduced extract_as_list.Alexis Jeandet2017-09-181-1/+8
| | | | | | | | | | | | Corrected code style and typo. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
* | Introduction of listify method. Test on build.py module to see benefits.Alexis Jeandet2017-09-181-0/+11
|/ | | | Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
* Add is_haiku(), needed for run_tests.py.Jérôme Duval2017-09-141-0/+3
|
* interpreter: Always flatten when unholding arraysNirbheek Chauhan2017-09-111-0/+1
| | | | | | | Otherwise we might end up with wrapper holders in the Build object and pickling will then fail, defeating the purpose of the holder objects. Closes https://github.com/mesonbuild/meson/issues/2211
* Allow version labels with trailing dotsMichal Koutný2017-09-041-1/+1
| | | | Fixes #1586
* Make all functionality invokable via the main Meson binary,Jussi Pakkanen2017-08-181-9/+0
| | | | which can be a Windows .exe file.
* configure_file: warn in case a variable to subsitute is not present in the ↵Christoph Reiter2017-07-211-2/+7
| | | | passed configuration. Fixes #2090
* Fix remaining Interpreter object leaks.Jussi Pakkanen2017-07-011-0/+8
|
* Make Interpreter object unpicklable as it was being pickled by accident in ↵Jussi Pakkanen2017-07-011-0/+5
| | | | copies of kwargs.
* Create helper function for a rmtree that works reliably on Windows.Jussi Pakkanen2017-05-211-0/+17
|
* Flatten should always return a listDylan Baker2017-05-111-1/+1
| | | | | | | | Currently if flatten() is passed a non-list object, it returns that object. This is surprising behavior, and prone to causing serious and numerous problems, since many objects implement the iterable interface, and thus can be used in cases a list is expected, but with undesirable results.
* Merge pull request #1751 from centricular/fix-cached-depsJussi Pakkanen2017-05-091-1/+1
|\ | | | | Fix caching of external dependencies of various types
| * Completely overhaul caching of external dependenciesNirbheek Chauhan2017-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old caching was a mess of spaghetti code layered over pasta code. The new code is well-commented, is clear about what it's trying to do, and uses a blacklist of keyword arguments instead of a whitelist while generating identifiers for dep caching which makes it much more robust for future changes. The only side-effect of forgetting about a new keyword argument would be that the dependency would not be cached unless the values of that keyword arguments were the same in the cached and new dependency. There are also more tests which identify scenarios that were broken earlier.
* | Implement difference method for OrderedSetDylan Baker2017-05-081-0/+3
| | | | | | | | | | | | This implementation is obvious rather than efficient, but it's efficient enough for our uses I think. It uses `type(self)` to guarantee that it works even in subclasses or if the name of the class changes.
* | Fix OrderedSet `__repr__` protocol for non-string objectsDylan Baker2017-05-081-1/+2
|/ | | | | Prefer using `repr` on the keys to `str` since `repr` is guaranteed to be implemented, and will return something "good enough"
* Don't use dict.keys() to check membershipDylan Baker2017-04-281-1/+1
| | | | | | It's much faster to do 'if a in dict' instead of 'if a in dict.keys()', since the latter constructs an iterator and walks that iterator and then tests equality at each step, and the former does a single hash lookup.
* Implement an actual set interface for the OrderedSet class. Closes #1670Dylan Baker2017-04-281-8/+28
| | | | | | | This uses the ABC's in collections to implement an OrderedSet class. Internally an OrderedDict is still wrapped so that the ordering is maintained, this adds the full interface and behavior of an Set, but with ordering by first insertion.
* Merge pull request #1548 from ssssam/sam/stable-orderingJussi Pakkanen2017-04-131-0/+16
|\ | | | | Stable ordering of some commandlines generated by 'gnome' module
| * Add a cheap OrderedSet implementationSam Thursfield2017-04-031-0/+16
| | | | | | | | | | | | | | | | This just makes an OrderedDict look more like a set class. This results in neater code than if we use OrderedDict to hold sets directly. There is a "real" OrderedSet implementation available here, but it lacks a clear license: https://code.activestate.com/recipes/576694/
* | Don't close fds when executing programsMichael Olbrich2017-04-131-0/+1
| | | | | | | | | | Tools that execute meson might open file descriptors for the programs to use. Such as a file descriptor for a logfile.
* | Merge pull request #1469 from centricular/install-secondary-outputsJussi Pakkanen2017-04-091-13/+10
|\ \ | | | | | | Support multiple install dirs for built/custom targets
| * | Support multiple install dirs for built/custom targetsNirbheek Chauhan2017-04-041-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now pass a list of strings to the install_dir: kwarg to build_target and custom_target. Custom Targets: =============== Allows you to specify the installation directory for each corresponding output. For example: custom_target('different-install-dirs', output : ['first.file', 'second.file'], ... install : true, install_dir : ['somedir', 'otherdir]) This would install first.file to somedir and second.file to otherdir. If only one install_dir is provided, all outputs are installed there (same behaviour as before). To only install some outputs, pass `false` for the outputs that you don't want installed. For example: custom_target('only-install-second', output : ['first.file', 'second.file'], ... install : true, install_dir : [false, 'otherdir]) This would install second.file to otherdir and not install first.file. Build Targets: ============== With build_target() (which includes executable(), library(), etc), usually there is only one primary output. However some types of targets have multiple outputs. For example, while generating Vala libraries, valac also generates a header and a .vapi file both of which often need to be installed. This allows you to specify installation directories for those too. # This will only install the library (same as before) shared_library('somevalalib', 'somesource.vala', ... install : true) # This will install the library, the header, and the vapi into the # respective directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : ['libdir', 'incdir', 'vapidir']) # This will install the library into the default libdir and # everything else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [true, 'incdir', 'vapidir']) # This will NOT install the library, and will install everything # else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [false, 'incdir', 'vapidir']) true/false can also be used for secondary outputs in the same way. Valac can also generate a GIR file for libraries when the `vala_gir:` keyword argument is passed to library(). In that case, `install_dir:` must be given a list with four elements, one for each output. Includes tests for all these. Closes https://github.com/mesonbuild/meson/issues/705 Closes https://github.com/mesonbuild/meson/issues/891 Closes https://github.com/mesonbuild/meson/issues/892 Closes https://github.com/mesonbuild/meson/issues/1178 Closes https://github.com/mesonbuild/meson/issues/1193
* | | Merge pull request #1518 from centricular/mesonintrospect-evarJussi Pakkanen2017-04-081-0/+9
|\ \ \ | | | | | | | | Export MESONINTROSPECT to postconf/install/run_command scripts
| * | | Export MESONINTROSPECT to postconf/install/run_command scriptsNirbheek Chauhan2017-03-281-0/+9
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Points to the `mesonintrospect.py` script corresponding to the currently-running version of Meson. Includes a test for all three methods of running scripts/commands. Closes https://github.com/mesonbuild/meson/issues/1385