aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/xcodebackend.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-20backends: simplify class setupEli Schwartz1-1/+3
2023-01-10backends: Stop passing generator exes to ExecutableSerialisation as stringsDylan Baker1-0/+2
The code below this already handles being passed an Executable or ExternalProgram, and it does it correctly, since it handles host binaries that need an exe_wrapper correctly, while the code in the generator paths doesn't. The xcode backend is, like always, problematic, it doesn't handle things the same way as the ninja and vscode backends, and generates a shell script instead of using meson as a wrapper when needed (it seems likely that just forcing the meson path for xcode would be better). I don't have a working mac to develop a fix for, so I've left a todo comment there. Fixes: #11264
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-09compilers: Add optimization=plain optionJan Tojnar1-2/+5
https://github.com/mesonbuild/meson/pull/9287 changed the `optimization=0` to pass `-O0` to the compiler. This change is reasonable by itself but unfortunately, it breaks `buildtype=plain`, which promises that ā€œno extra build flags are usedā€. `buildtype=plain` is important for distros like NixOS, which manage compiler flags for optimization and hardening themselves. Let’s introduce a new optimization level that does nothing and set it as the default for `buildtype=plain`.
2022-06-14backend: always use the same code to compute the files in ExtractedObjectsPaolo Bonzini1-4/+1
Instead of asking the ExtractedObjects, but with a hook back into the backend, use the existing function in the backend itself. This fixes using the extract_objects(...) of a generated source file in a custom_target. It should also fix recursive extract_all_objects with the Xcode backend. Fixes: #10394
2022-06-10treewide: various cleanups to move imports for mypy into typechecking blocksEli Schwartz1-4/+7
Along the way, add __future__ annotations where lacking.
2022-03-31Handle same Framework multiple times in Xcode.Jussi Pakkanen1-2/+4
2022-03-31Handle feed and capture in xcodebackend.Jussi Pakkanen1-1/+2
2022-03-30Fix typos in Xcode backend.Jussi Pakkanen1-3/+3
2022-03-29Replace backend.get_option_for_target() with target.get_option()Xavier Claessens1-4/+4
That method had nothing specific to the backend, it's purely a Target method. This allows to cache the OptionOverrideProxy object on the Target instance instead of creating a new one for each option lookup.
2022-03-22backends: Stop separating base and compiler optionsXavier Claessens1-1/+1
Since OptionKey is used we can mix all options together in a single dictionary. That's already what we do in coredata.options.
2022-01-27flake8: fix wonky comment styleEli Schwartz1-1/+1
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-2/+2
2021-10-04fix extra whitespaceEli Schwartz1-4/+0
discovered via flake8 --select E303
2021-10-04remove useless variables that are no longer or were never usedEli Schwartz1-1/+0
2021-09-14fix untested codepath? add:item() is surely a typo, not a real functionEli Schwartz1-1/+1
2021-08-31pyllint: enable consider-user-enumerateDylan Baker1-6/+2
This caught a couple of cases of us doing: ```python for i in range(len(x)): v = x[i] ``` which are places to use enumerate instead. It also caught a couple of cases of: ```python assert len(x) == len(y) for i in range(len(x)): xv = x[i] yv = y[i] ``` Which should instead be using zip() ```python for xv, yv in zip(x, y): ... ```
2021-08-31pylint: turn on superflous-parensDylan Baker1-16/+16
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-08-31pylint: enable consider-iterating-dictionaryDylan Baker1-1/+1
This didn't actually catch what it's supposed to, which is cases of: ```python for x in dict.keys(): y = dict[x] ``` But it did catch one unnecessary use of keys(), and one case where we were doing something in an inefficient way. I've rewritten: ```python if name.value in [x.value for x in self.kwargs.keys() if isinstance(x, IdNode)]: ``` as ``python if any((isinstance(x, IdNode) and name.value == x.value) for x in self.kwargs): ``` Which avoids doing two iterations, one to build the list, and a second to do a search for name.value in said list, which does a single short circuiting walk, as any returns as soon as one check returns True.
2021-08-21Fix duplicated frameworks in the Xcode backend.Jussi Pakkanen1-1/+7
2021-08-21Fix multiple generators in target in Xcode.Jussi Pakkanen1-2/+2
2021-08-21Path special casing for the Xcode backend.Jussi Pakkanen1-1/+5
2021-08-21Handle .C extension in Xcode.Jussi Pakkanen1-1/+4
2021-08-20backends: remove unused name parameter from as_meson_exe_cmdlineDylan Baker1-2/+1
This parameter isn't used, at all, so just remove it
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz1-15/+15
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz1-1/+1
2021-06-07another pyupgrade passEli Schwartz1-3/+3
2021-05-23Add swift executable support in Xcode.Jussi Pakkanen1-1/+8
2021-05-23Remove unnecessary hierarchical layer.Jussi Pakkanen1-10/+4
2021-05-23Remove top level sources entry as unnecessary.Jussi Pakkanen1-24/+6
2021-05-23Add meson.build files to pbxgroup.Jussi Pakkanen1-9/+31
2021-05-23Write project info in a tree structure rather than the current flat one.Jussi Pakkanen1-37/+97
2021-04-29Xcode: fix project cleaning.Jussi Pakkanen1-2/+2
2021-04-25Xcode: make Swift projects work.Jussi Pakkanen1-1/+8
2021-04-25Xcode: add objective C++ flags to plain C++ because Xcode requires it.Jussi Pakkanen1-1/+3
2021-04-25Xcode: add objective C flags to plain C because Xcode requires it.Jussi Pakkanen1-2/+9
2021-04-24Xcode: fix linking to customtargetindex objects.Jussi Pakkanen1-7/+28
2021-04-23Xcode: even more command line argument expansion.Jussi Pakkanen1-1/+6
2021-04-23Xcode: Quote McQuoteface.Jussi Pakkanen1-2/+2
2021-04-23Xcode: handle CustomTargetIndexes.Jussi Pakkanen1-6/+20
2021-04-23Xcode: ever more quoting.Jussi Pakkanen1-1/+4
2021-04-23Xcode: only add source and build dirs if implicit_include_directories is set.Jussi Pakkanen1-2/+3
2021-04-22Xcode: do not link shared modules against executables.Jussi Pakkanen1-0/+2
2021-04-22Xcode: add missing quote character.Jussi Pakkanen1-1/+1
2021-04-22Xcode: fix shell quotings.Jussi Pakkanen1-2/+2
2021-04-22Xcode: skip link language override test.Jussi Pakkanen1-1/+1
2021-04-21Xcode: put all include dirs via a property rather than a cmd line arg.Jussi Pakkanen1-6/+9
2021-04-21Xcode: add target private dir to include path.Jussi Pakkanen1-0/+1
2021-04-21Xcode: quote some entries as needed.Jussi Pakkanen1-2/+8
2021-04-20Xcode: fix file objects in various places.Jussi Pakkanen1-13/+31