aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
AgeCommit message (Collapse)AuthorFilesLines
2021-08-10ninjabackend: use get_subdir() instead of subdir attribute for cythonDylan Baker1-1/+1
As this works correctly for CustomTarget, CustomTargetIndex, and GeneratedList, but .subdir doesn't work for CustomTargetIndex.
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz1-1/+1
2021-07-02backends/ninja: only pass project specific arguments to scan-buildDylan Baker1-1/+2
Currently all arguments are being passed to scan-build as part of the refactoring of how Meson internally handles arguments, but that's wrong, only project specific arguments are supposed to be passed. Fixes: #8818
2021-06-29Add feed arg to custom_target()Simon Ser3-11/+23
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger3-9/+11
2021-06-28 build: fix object path for vs backendDenis Fortin1-1/+8
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger1-2/+2
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
2021-06-23Merge pull request #8884 from dcbaker/submit/type-and-annotate-install-functionsJussi Pakkanen1-4/+6
Add annotations for the various install_* functions
2021-06-22Add Visual Studio 2012/2013 backends (#8803)fanc9994-5/+117
* 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-06-22install_*: FileMode doesn't need to be NoneDylan Baker1-3/+0
There's no reason to allow None into the backend, it already has code to check that all of the values of the FileMode object are None, so let's use that, which is much simpler all the way down.
2021-06-22backend: Headers.install_subdir is allowed to be NoneDylan Baker1-1/+6
But we don't properly handle that.
2021-06-18holders: remove unholderDaniel Mensinger2-11/+11
2021-06-14backends: fix TestSerialisation.suite annotationsDylan Baker1-1/+1
It's a `str[]` not `str`
2021-06-14Fix issue with generated Cython code in a subdirRalf Gommers1-0/+2
This is a follow-up to gh-8706, which contained the initial fix to ninjabackend.py but somehow lost it. This re-applies the fix and adds a test for it. Without the fix, the error is: ninja: error: 'ct2.pyx', needed by 'libdir/ct2.cpython-39-x86_64-linux-gnu.so.p/ct2.pyx.c', missing and no known rule to make it
2021-06-07another pyupgrade passEli Schwartz1-3/+3
2021-06-07condense linesEli Schwartz2-10/+5
2021-06-07more f-strings everywhereEli Schwartz2-38/+33
pyupgrade didn't catch many .format() methods which were too complex (e.g. multiline or applied to templates rather than string literals)
2021-06-07cython: Add an option for selecting python 3 vs python 2 outputDylan Baker1-2/+13
2021-06-07ninjabackend: generate cython compilation rulesDylan Baker1-0/+61
2021-06-07ninjabackend: cython doesn't use a linkerDylan Baker1-4/+1
2021-06-02add a couple more type annotationsDylan Baker1-1/+1
2021-06-02use an immutable list for an lru_cached functionsDylan Baker2-12/+16
When mutable items are stored in an lru cache, changing the returned items changes the cached items as well. Therefore we want to ensure that we're not mutating them. Using the ImmutableListProtocol allows mypy to find mutations and reject them. This doesn't solve the problem of mutable values inside the values, so you could have to do things like: ```python ImmutableListProtocol[ImmutableListProtocol[str]] ``` or equally hacky. It can also be used for input types and acts a bit like C's const: ```python def foo(arg: ImmutableListProtocol[str]) -> T.List[str]: arg[1] = 'foo' # works while running, but mypy errors ```
2021-05-30Only try to get RSP syntax if RSP is supported (#8804)Dylan Baker1-13/+23
2021-05-28vsenv: Recommend using "meson compile" wrapperXavier Claessens1-0/+8
When meson has setup the VS environment, running ninja to build won't work, user should use meson wrapper to compile.
2021-05-27ninjabackend.py: Implement `link_whole:` for pre-VS2015Chun-wei Fan1-3/+20
...Update 2, to be exact, since the Visual Studio linker only gained the `/WHOLEARCHIVE:` feature since Visual Studio 2015 Update 2. This checks whether we have the corresponding `cl.exe` which is versioned at or after Visual Studio 2015 Update 2 before we try to apply the `/WHOLEARCHIVE:xxx` linker flag. If we aren't, use built-in methods in Meson to grab the object files of the dependent static lib's, along with the objects that were `link_whole:`'ed into them, and feed this list into the linker instead. This would make `link_whole:` work on Visual Studio 2015 Update 1 and earlier, including previous Visual Studio versions.
2021-05-23Add swift executable support in Xcode.Jussi Pakkanen3-7/+14
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-05-19backends: use a set for processed targets instead of a dictDylan Baker2-4/+4
We're only interested in the keys, not in the value (which was always set to True), so a set is a better data structure anyway.
2021-05-19ninjabackend: Fix vala type annotationsDylan Baker1-24/+26
2021-05-19rust: override get_linker_always_argsDylan Baker1-2/+1
instead of opencoding what should be there in the rust compile rule
2021-05-18Add a rust test for internal c linkageDylan Baker1-5/+12
We have code to support this, but no tests. That seems pretty bad. And better yet, it doesn't work on MSVC in some cases.
2021-05-17ninjabackend: fix linking dynamic c libraries with rustDylan Baker1-1/+1
The correct name is "dylib" not "shared"
2021-05-15Visual Studio Address Sanitizer updatesPeter Harris1-0/+10
* Allow address sanitizer for Visual Studio 2019 version 16.9 Address Sanitizer was first supported with the current syntax in Visual Studio 16.9.0 (cl version 19.28.29910). * VS: Convert /fsanitize=address to project file setting
2021-05-08ninjabackend: Add pch includes as early as possible not to be overriddenMarco Trevisan (Treviño)1-4/+18
When pch are used for a target meson will make the compiler to include the pre-compiled header. While this is useful, this needs to happen before any other header has been included, otherwise: 1) we won't take advantage of pch for anything else previously included 2) gcc will just fail as it won't even try to look for a pre-compiled header in this case [1] This case can happen quite a easily when a dependency provides an included header in its cflags. As per this, split _generate_single_compile() in two phases, one is responsible of initializing the compiler data, while the other is defining commands for the context. In this way, when pch can be used, we can insert the pch inclusion earlier than any other provided by the target. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100462
2021-04-29Xcode: fix project cleaning.Jussi Pakkanen1-2/+2
2021-04-26introspection: export all sources for custom targetsJason Francis1-0/+2
Also adds some test cases for source files in target_sources.
2021-04-25Xcode: make Swift projects work.Jussi Pakkanen3-7/+14
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