aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
AgeCommit message (Collapse)AuthorFilesLines
2021-08-20Fix duplicated frameworks in the Xcode backend.xcodegodotJussi Pakkanen1-1/+7
2021-08-20Fix multiple generators in target in Xcode.Jussi Pakkanen1-2/+2
2021-08-20Path special casing for the Xcode backend.Jussi Pakkanen2-2/+8
2021-08-20Handle .C extension in Xcode.Jussi Pakkanen1-1/+4
2021-08-18backends/ninja: write depscan input files to jsonDylan Baker1-9/+18
Currently, we write each file to the command line, but this can result in situations where the number of files passed exceeds OS imposed command line limits. For compilers, we solve this with response files. For depscan I've chosen to use a JSON list instead. JSON has several advantages in that it's standardized, there's a built-in python module for it, and it's familiar. I've also chosen to always use the JSON file instead of having a heuristic to decide between JSON and not JSON, while there may be a small performance trade off here, keeping the implementation simple with only one path is wort it. Fixes #9129
2021-08-17rust targets: lld-link is the same as link for static libsNirbheek Chauhan1-3/+3
Without this, rustc will fail to find libfoo.a; same as with MSVC.
2021-08-17Add install tagsXavier Claessens2-20/+62
Fixes: #7007.
2021-08-15Refresh Ninja cache files on regeneration.Jussi Pakkanen1-0/+3
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-08-11Always generate Java rule, it is platform agnostic.Jussi Pakkanen1-2/+1
2021-08-09Fix native targets for vs backend cross compilationGustavoLCR1-10/+40
2021-08-03ninjabackend: 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-23Add support for gcovr --sonarqube reportWeston Schmidt1-0/+7
Sonarcloud.io only can read the sonarqube based report that gcovr can produce. This change enables support for this output in meson and ninja. Signed-off-by: Weston Schmidt <Weston_Schmidt@alumni.purdue.edu>
2021-07-14linkers: remove is_shared_module argument to get_soname_argsPaolo Bonzini1-2/+1
The argument is now unused, drop it.
2021-07-14do not add SONAME to shared modulesPaolo Bonzini1-5/+6
For an ELF targets, shared_module() builds a module with SONAME field (using -Wl,-soname argument). This is wrong: only the shared_library() needs SONAME, while shared_module() does not. Moreover, tools such as debian's dpkg-shlibdeps use presence of SONAME field as an indicator that this is shared library as opposed to shared module (e.g., for the module it is okay to have unresolved symbols which are imported from the executable which loads the module, while a library should have all symbols resolved). This was in fact already the behavior on Darwin; extend it to ELF targets as well. Fixes: #8746 Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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