aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/traceparser.py
AgeCommit message (Collapse)AuthorFilesLines
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2023-02-01pyupgrade: use set literalEli Schwartz1-1/+1
2022-11-30pylint: enable the set_membership pluginDylan Baker1-3/+3
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
2022-11-29pylint: enable the bad_builtin checkerDylan Baker1-1/+1
This finds uses of deny-listed functions, which defaults to map and filter. These functions should be replaced by comprehensions in idiomatic python because: 1. comprehensions are more heavily optimized and are often faster 2. They avoid the need for lambdas in some cases, which make them faster 3. you can do the equivalent in one statement rather than two, which is faster 4. They're easier to read 5. if you need a concrete instance (ie, a list) then you don't have to convert the iterator to a list afterwards
2022-10-04pylint: enable use-a-generatorDylan Baker1-1/+1
This catches some optimization problems, mostly in the use of `all()` and `any()`. Basically writing `any([x == 5 for x in f])` vs `any(x == 5 for x in f)` reduces the performance because the entire concrete list must first be created, then iterated over, while in the second f is iterated and checked element by element.
2022-09-19pylint: enable consider-using-inDylan Baker1-1/+1
2022-08-26Fix purely white space issues reported by flake8Alf Henrik Sauge1-15/+15
2022-07-18Applied tristan957's suggestionsVolker Weißmann1-2/+1
2022-07-18cmake module: Better warnings and error messages in some cases.Volker Weißmann1-0/+7
2022-04-18Fix generator expression list problems (fixes #10288)Daniel Mensinger1-6/+7
2022-04-03cmake: Better error message when configuring a CMake subproject fails.Daniel Mensinger1-0/+15
2022-03-07Merge pull request #9743 from mensinda/cmakeGeneratorFixedJussi Pakkanen1-3/+37
cmake: Add TARGET_ generator expression support (fixes #9305)
2022-02-16flake8: fix wrong numbers of blank line separatorsEli Schwartz1-0/+1
2022-02-03cmake: Deprecate CMake <3.17 supportDaniel Mensinger1-0/+11
2022-01-23cmake: Add TARGET_ generator expression support (fixes #9305)Daniel Mensinger1-5/+10
2022-01-23cmake: Move generator expression evaluation to the end of the traceparserDaniel Mensinger1-2/+31
2021-08-31pylint: turn on superflous-parensDylan Baker1-2/+2
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz1-2/+2
2021-07-05fix typo in log messageEli Schwartz1-1/+1
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-05-29cmake: CMakeTraceParser improvementsDaniel Mensinger1-13/+41
- handle cached CMake variables differently - associate variables with source files - better performance (str to Path and generator expressions)
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-11/+11
performed by running "pyupgrade --py36-plus" and committing the results
2021-01-13Fix misspellsAntonin Décimo1-1/+1
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2020-11-20use real pathlib moduleDylan Baker1-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
2020-10-24cmake: Disable the new (CMake 3.16) PCH supportDaniel Mensinger1-0/+8
Subprojects that use the CMake PCH feature will cause compilation/linker errors. The CMake PCH support should thus be disabled until this can be properly translated to meson.
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-1/+1
2020-10-04cmake: switch to pathlib (fixes #7322)Daniel Mensinger1-20/+25
2020-09-28typing: fully annotate cmake.traceparserDaniel Mensinger1-32/+45
2020-08-07cmake: make the traceparser permissive by default (fixes #7501)Daniel Mensinger1-1/+1
2020-08-03cmake: resolve IMPORTED executables in custom commands (fixes #7509)Daniel Mensinger1-1/+2
2020-06-09cmake_traceparser: ignore parse errorMichael Hirsch1-1/+1
2020-06-02cmake: always split property lists (fixes #7228)Daniel Mensinger1-2/+3
2020-04-28Adding a conditional case in _guess_files to confirm that the complete path ↵georgev931-1/+16
is put together in even if a portion of the path is a location that exists. For instance if C:/Program Files (x86)/folder is passed to _guess_files, it would resolve to ['C:/Program Files', '(x86)/folder'] since C:/Program Files is an actual file location that can exist.
2020-04-24Adjust regex to handle cases such as C:/Program Files/foldergeorgev931-1/+1
2020-04-17cmake: Do not compile explicit header filesDaniel Mensinger1-14/+47
2020-04-12cmake: Fix custom command CMake list issueDaniel Mensinger1-4/+11
2020-02-20cmake: Fix relative paths for add_custom_{command,target}Daniel Mensinger1-19/+58
Do this by tracking CMAKE_CURRENT_{SOURCE,BINARY}_DIR variables. This is achieved by injecting CMake code with CMAKE_PROJECT_INCLUDE and overriding some builtin functions with a wrapper that adds additional trace information.
2020-02-19cmake: traceparser better handle listsDaniel Mensinger1-3/+4
2020-02-12cmake: Add support for the new JSON trace formatDaniel Mensinger1-15/+38
2020-02-04cmake: Fix spaces in compile flags (fixes #6566)Daniel Mensinger1-5/+13
2020-01-26cmake: Add support for --trace-redirectDaniel Mensinger1-0/+13
2020-01-26cmake: Refactor CMakeExecutor and CMakeTraceParserDaniel Mensinger1-6/+25
This moves most of the execution code from the CMakeInterpreter into CMakeExecutor. Also, CMakeTraceParser is now responsible for determining the trace cmd arguments.
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-14/+14
2019-12-29cmake: Use trace for missing link flags (fixes #6386)Daniel Mensinger1-3/+8
This is neccessary for static libraries, since the CMake file API does not add link flags here.
2019-11-27cmake: Add support for add_custom_target() with a commandXavier Claessens1-6/+9
The command could have no output, in which case we create a dummy one.
2019-11-27cmake: Add support for add_dependencies()Xavier Claessens1-0/+15
Closes: #5983
2019-11-06Fix typos found by codespellWolfgang Stöggl1-2/+2
- Typos were found by codespell v1.16.0
2019-10-20cmake: Do not add imported targetsDaniel Mensinger1-8/+10
2019-10-01cmake: Add support for normal librariesXavier Claessens1-1/+3
Without this, set_target_properties() on those libraries won't be catched, for example when setting the SOVERSION.
2019-10-01cmake: Fix 'properies' typoXavier Claessens1-15/+15