aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/common.py
AgeCommit message (Collapse)AuthorFilesLines
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2022-11-30pylint: enable the set_membership pluginDylan Baker1-2/+2
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-08-26Fix purely white space issues reported by flake8Alf Henrik Sauge1-26/+26
2021-12-01cmake: Fix old style dependency lookup with imported targetsDaniel Mensinger1-0/+12
This also includes some refactoring, since the alternaticve would have been to duplicate the huge traceparser target code block again. fixes #9581
2021-11-21Support Visual Studio 2022 backendCrend King1-0/+1
2021-06-22Add Visual Studio 2012/2013 backends (#8803)fanc9991-1/+3
* backends: Add a Visual Studio 2013 backend This is more-or-less a quick port from the VS2015 backend, except that we update the Visual Studio version strings and toolset versions accordingly. Also correct the generator string for Visual Studio 2015 in mesonbuild/cmake/common.py. * backend: Add VS2012 backend Similar to what we did for Visual Studio 2013, add a Visual Studio 2012 backend. * vs2010backend.py: Implement `link_whole:` if needed We actually need Visual Studio 2015 Update 2 to use `/WHOLEARCHIVE:`, which is what we are currently using for `link_whole:` on Visual Studio. For Visual Studio versions before that, we need to expand from the static targets that were indicated by `link_whole:`, and any of the sub-dependent targets that were pulled in via the dependent target's `link_whole:`. This wil ensure `link_whole:` would actually work in such cases. * vs2010backend.py: Handle objects from generated sources Unforunately, we can't use backends.determine_ext_objs() reliably, as the Visual Studio backends handle this differently. * vs2010backend.py: Fix generating VS2010 projects Visual Studio 2010 (at least the Express Edition) does not set the envvar %VisualStudioVersion% in its command prompt, so fix generating VS2010 projects by taking account into this, so that we can determine the location of vcvarsall.bat correctly. * whole archive test: Disable on vs2012/2013 backends too The Visual Studio 2012/2013 IDE has problems handling the items that would be generated from this test case, so skip this test when using --backend=vs[2012|2013]. This test does work for the Ninja backend when VS2012 or VS2013 is used, though. Consolidate this error message with XCode along with the vs2010 backend. * docs: Add the new vs2012 and vs2013 backends Let people know that we have backends for vs2012 and 2013. Also let people know that generating Visual Studio 2010 projects have been fixed and the pre-vs2015 backends now handle the `link_whole:` project option.
2021-05-30cmake: select correct generator in toolchain.pyDaniel Mensinger1-1/+19
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-8/+8
performed by running "pyupgrade --py36-plus" and committing the results
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-16cmake: Ignore additional internal CMake variablesDaniel Mensinger1-0/+9
2020-10-16cmake: ignore CMAKE_TOOLCHAIN_FILE and CMAKE_PROJECT_INCLUDE to avoid ↵Daniel Mensinger1-0/+24
conflicts with the meson CMake logic
2020-10-13cmake: Add cross compilation supportDaniel Mensinger1-0/+12
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-21/+22
2020-09-27typing: fully annotate cmake.commonDaniel Mensinger1-40/+48
2020-06-05cmake: Add more advanced subproject configuration optionsDaniel Mensinger1-0/+95
This is done with the new cmake subprojects options object that is similar to the already exisiting configuration data object. It is consumed by the new `options` kwarg of the cmake.subproject function.
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-2/+2
2019-11-19cmake: Handle CMake system include dirs (closes #6079)Daniel Mensinger1-2/+3
2019-10-20cmake: Comment out unused variablesDaniel Mensinger1-4/+4
2019-10-20cmake: Move CMake API classes to commonDaniel Mensinger1-0/+143
2019-06-06cmake: Server handshakeDaniel Mensinger1-0/+21