aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
AgeCommit message (Collapse)AuthorFilesLines
2022-02-01mtest: support for forcibly verbose logging of some testsPaolo Bonzini1-1/+3
Store in TestSerialisation whether a particular test must always be logged verbosely. This is particularly useful for long-running tests or when a single Meson test() is wrapping an external test harness. In this case, TAP can be used by the external harness and Meson will log each subtest as it runs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-02-01backends/ninja: generate symlink aliases for rust/cs/swift libraries tooEli Schwartz1-1/+3
Basically the last thing we did during target processing was to generate shlib symlinks for e.g. libfoo.so -> libfoo.so.1. In some cases we would dispatch to another function and return early, though, which meant we never got far enough to generate the symlinks. This then led to breakage when people tried to compile against libfoo.so This surely breaks -uninstalled.pc usage, and also caused problems in https://github.com/rust-lang/rust/pull/90260
2022-01-30ninja backend: Fix usage of same constants file for native and crossNirbheek Chauhan1-7/+7
For example: ``` meson builddir \ --native-file vs2019-paths.txt \ --native-file vs2019-win-x64.txt \ --cross-file vs2019-paths.txt \ --cross-file vs2019-win-arm64.txt ``` This was causing the error: > ERROR: Multiple producers for Ninja target "/path/to/vs2019-paths.txt". Please rename your targets. Fix it by using a set() when generating the list of regen files, and add a test for it too.
2022-01-27flake8: fix wonky comment styleEli Schwartz1-1/+1
2022-01-18build: Fix return types of a couple of methodsDylan Baker1-1/+1
These don't return `Target`, they return `BuildTarget | CustomTarget | CustomTargetIndex`
2022-01-12ninja backend: Fix custom_target() console: kwarg when using envDeclan Qian1-1/+2
When a custom_target() uses an env, meson uses a wrapper script to run the executable. This breaks the console: kwarg because the wrapper script buffers the output. Fix it by setting the verbose flag which will not buffer output.
2022-01-10first pass at migrating to dataclassesEli Schwartz1-111/+96
In some cases, init variables that accept None as a sentinel and immediately overwrite with [], are migrated to dataclass field factories. \o/ Note: dataclasses by default cannot provide eq methods, as they then become unhashable. In the future we may wish to opt into declaring them frozen, instead/additionally.
2022-01-10clean up even more function signatures in preparation for dataclassesEli Schwartz1-2/+2
Names used in init functions are sometimes pointlessly different from the class instance attributes they are immediately assigned to. They would make more sense if defined properly.
2021-12-22Don't wipe out RPATHs specified by dependenciesNirbheek Chauhan1-1/+7
Since we scan all dependencies for build-only RPATHs now (which are removed on install), we must take care not to add build-only RPATHs pointing to directories that dependencies explicitly add -Wl,-rpath link args for, otherwise the paths will get wiped on install. Caught by LinuxlikeTests::test_usage_pkgconfig_prefixes
2021-12-22Set RPATH for all non-system libs with absolute pathsNirbheek Chauhan1-28/+27
If a pkg-config dependency has multiple libraries in it, which is the most common case when it has a Requires: directive, or when it has multiple -l args in Libs: (rare), then we don't add -Wl,-rpath directives to it when linking. The existing test wasn't catching it because it was linking to a pkgconfig file with a single library in it. Update the test to demonstrate this. This function was originally added for shared libraries in the source directory, which explains the name: https://github.com/mesonbuild/meson/pull/2397 However, since now it is also used for linking to *all* non-system shared libraries that we link to with absolute paths: https://github.com/mesonbuild/meson/pull/3092 But that PR is incomplete / wrong, because only adding RPATHs for dependencies that specify a single library, which is simply inconsistent. Things will work for some dependencies and not work for others, with no logical reason for it. We should add RPATHs for *all* libraries. There are no special length limits for RPATHs that I can find. For ELF, DT_RPATH or DT_RUNPATH are used, which are just stored in a string table (DT_STRTAB). The maximum length is only a problem when editing pre-existing tags. For Mach-O, each RPATH is stored in a separate LC_RPATH entry so there are no length issues there either. Fixes https://github.com/mesonbuild/meson/issues/9543 Fixes https://github.com/mesonbuild/meson/issues/4372
2021-12-11install: Don't run ldconfig on cross buildsDylan Baker1-2/+5
Even if we install without a DESTDIR set, we should never update ldconfig when cross compiling. Fixes #9707
2021-12-06allow passing a CustomTargetIndex as argument to a testPaolo Bonzini1-3/+5
Fixes: #7585 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-06pass all outputs of a custom_target as arguments to a testPaolo Bonzini1-12/+19
Meson was passing only the first output and warning about it. To do this easily, refactor construct_target_rel_path to return a list. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-06Fix performance regression in build file generationcomplexoctonion1-1/+2
Re-use any already determined rpaths for a target. Fixes #9695
2021-12-05rename exe_runner to exe_wrapper everywhereEli Schwartz1-3/+3
I don't understand the purpose of this confusing API naming split.
2021-12-01add install_symlink functionPablo Correa Gómez1-0/+20
Allows installing symlinks directly from meson, which can become useful in multiple scenarios. Current main use is to help moving forward #9557
2021-11-28fix BSD ldconfig handling (#9631)Eli Schwartz1-1/+3
For libraries installed to libdir, it's not expected to have rpath hooked up. But for non-default libdirs, the path might not get searched by default. `ldconfig -m <libdir>` is convenient here, as it will programmatically add a new directory to search for shared libraries, so the resulting installed programs work out of the box. Include the dragonfly BSD platform name, which doesn't match the 'bsd' catch-all pattern.
2021-11-27Fix '# Visual Studio <>' comment in sln files with VS backendLuke Elliott7-5/+20
such that Visual Studio Version Selector works.
2021-11-25Stop backend_startup_project from erasing the last project in a VS solutionLuke Elliott1-1/+1
if it is not the specified project.
2021-11-24shared_module: Add soname when used as a link targetNirbheek Chauhan1-1/+1
Emit a detailed deprecation warning that explains what to do instead. Also add a unittest. ``` DEPRECATION: target prog links against shared module mymod, which is incorrect. This will be an error in the future, so please use shared_library() for mymod instead. If shared_module() was used for mymod because it has references to undefined symbols, use shared_libary() with `override_options: ['b_lundef=false']` instead. ``` Fixes https://github.com/mesonbuild/meson/issues/9492
2021-11-24backends/backends: recurse when looking for paths in bundled shared librariesDylan Baker1-0/+3
This previously worked because we were accidentally doing this via mutation. However, doing this via mutation is not a good way to do it, we should be explicit. Fixes #9542
2021-11-24build|backend: Fix some type annotationsDylan Baker1-7/+11
These currently say the take `Target`, but the really take `BuildTarget | CustomTarget | CustomTargetIndex`.
2021-11-24backends/backends: fix typo in commentDylan Baker1-1/+1
2021-11-21Support Visual Studio 2022 backendCrend King3-0/+64
2021-11-21Run pylintGustavoLCR1-28/+36
2021-11-21Fix vs backend cross compilation regressionGustavoLCR1-6/+15
2021-11-15valac dependencies: use the canonical list of vala source namesEli Schwartz1-1/+1
Don't hardcode one of the three possible source types, thus ignoring the needed vapis for dependencies using .gs or .vapi sources. Fixes #9544
2021-11-02Move language standard in separate method within vsbackendMoroz Oleg3-9/+24
2021-11-02Fixes .vcxproj for vs2017 vs2019Олег Мороз1-0/+9
fixes #6314 in case of backend is vs2017 or vs2019 place LanguageStandard tag with stdcpp version and LanguageStandard_C tag with stdc version in .vcxproj file
2021-11-01various manual conversion of percent-formatted strings to f-stringsEli Schwartz2-12/+11
2021-11-01fix typoed vs backend tokenEli Schwartz1-1/+1
2021-11-01coverage generator: obey the documentation and only generate supported outputsEli Schwartz1-26/+34
We say: > If version 4.2 or higher of the first is found, targets coverage-text, > coverage-xml, coverage-sonarqube and coverage-html are generated. But this is totally untrue. Make it true, by actually checking (and not generating broken coverage commands when older versions of gcovr are found). Fixes #9505
2021-10-29Fix version requirement on Ninja feature.Jussi Pakkanen1-1/+1
2021-10-29Make environment objects hash deterministically.Jussi Pakkanen1-3/+8
2021-10-27fix various flake8 whitespace errorsEli Schwartz2-8/+8
2021-10-10Add --vsenv command line option and active VS only when neededXavier Claessens1-2/+1
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-10-10ar linker: generate thin archives for uninstalled static librariesEli Schwartz1-1/+1
Since they will never be used outside of the build directory, they do not need to literally contain the .o files, and references will be sufficient. This covers a major use of object libraries, which is that the static library would potentially take up a lot of space by including another copy of every .o file. Fixes #9292 Fixes #8057 Fixes #2129
2021-10-10Merge pull request #9373 from anarazel/vs-build-speedJussi Pakkanen1-170/+69
backend/vs: Parallelize compilation inside one project
2021-10-08add install_emptydir functionEli Schwartz1-0/+15
This replaces the absolute hack of using ``` install_subdir('nonexisting', install_dir: 'share') ``` which requires you to make sure you don't accidentally or deliberately have a completely different directory with the same name in your source tree that is full of files you don't want installed. It also avoids splitting the name in two and listing them in the wrong order. You can also set the install mode of each directory component by listing them one at a time in order, and in fact create nested structures at all. Fixes #1604 Properly fixes #2904
2021-10-08backend/vs: Parallelize compilation inside one project.Andres Freund1-0/+1
UseMultiToolTask allows parallelism inside a project, without requiring cl.exe internal multi-threading (which meson generated projects currently can't use, mainly due to specifying output filenames for each object). TODO: - think about making behaviour conditional on msbuild version / add comment why not
2021-10-08backend/vs: Deduplicate basic project template.Andres Freund1-171/+61
Note that a few minor details of the output changed for some target types. I think I called them out with XXXs in the code for now.
2021-10-08backend/vs: Name pch pdb files to avoid naming & lock conflicts.Andres Freund1-0/+7
2021-10-08backend/vs: Move Microsoft.Cpp.props to before ItemDefinitionGroup.Andres Freund1-2/+3
The main reason for this move is to make it easier to merge the copies of project generation. But as far as I can tell, the Microsoft.Cpp.props import also belongs before the ItemDefinitionGroup. Originally the order seems to have been that way, but 431a9ea664 changed it in the course of other changes.
2021-10-04backend/vs: process link dependencies.Andres Freund1-0/+10
Partially-Fixes: #1799
2021-10-04fix extra whitespaceEli Schwartz3-7/+0
discovered via flake8 --select E303
2021-10-04remove useless variables that are no longer or were never usedEli Schwartz2-2/+0
2021-10-01rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker1-1/+6
Otherwise changes to a dependency don't propogate
2021-09-30Make custom_target() name argument optionalXavier Claessens1-1/+2
2021-09-24ninjabackend: Rust use Backend.generate_basic_compiler_argsDylan Baker1-9/+1
Instead of open coding it. This simplifies things, and fixes some missing functionality