summaryrefslogtreecommitdiff
path: root/mesonbuild/backend
Commit message (Collapse)AuthorAgeFilesLines
* Add mypy annotations.cppmodulesJussi Pakkanen2020-12-131-1/+1
|
* Scan all C++ sources and ignore everything else.Jussi Pakkanen2020-12-131-5/+33
|
* C++ module compilation works for a simple project.Jussi Pakkanen2020-12-131-5/+21
|
* Generate dependency scanning hooks in the Ninja file.Jussi Pakkanen2020-12-121-9/+45
|
* Generate scanning rules for C++ modules.Jussi Pakkanen2020-12-111-0/+24
|
* Add prelinking support for static libraries.Jussi Pakkanen2020-12-031-1/+20
|
* Bump Ninja requirement to 1.8.Jussi Pakkanen2020-11-261-2/+2
|
* use real pathlib moduleDylan Baker2020-11-203-3/+3
| | | | | 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
* ninjabackend: stabilize order of dependencies and order-only dependenciesPaolo Bonzini2020-11-151-2/+2
| | | | | | | | | | | These do not go into the command line, and therefore do not matter for the purpose of avoiding unnecessary rebuilds after meson is rerun. However, they complicate the task of finding differences between build lines across meson reruns. So take the easy way out and sort everything after | and ||. With this change, there is absolutely no change in QEMU's 40000-line build.ninja file after meson is rerun.
* ninjabackend: Fix a couple of rust bugsDylan Baker2020-11-131-2/+3
| | | | | | There are two bugs here, first is that we open coded the output args, instead of using the compiler method. The second is that rust args are not passed down to the backend invocation.
* ninjabackend: fix matching of empty stringsAlexander Neumann2020-11-131-1/+1
| | | closes #7977
* ninjabackend: apply base compile_args to rust targetsDylan Baker2020-11-101-2/+5
|
* rust: implement support for --editionDylan Baker2020-11-051-0/+3
| | | | | | | | | Using the std option, so now `rust_std=..` will work. I've chosen to use "std" even though rust calls these "editions", as meson refers to language versions as "standards", which makes meson feel more uniform, and be less surprising. Fixes: #5100
* build: use PIE objects for static libraries if b_staticpic=false but b_pie=truePaolo Bonzini2020-10-181-1/+1
| | | | | | | | | | | | If static_library is used as a convenience library (e.g. for link_whole) it should in principle not need position independent code. However, if the executables that the libraries is linked to are PIE, the non-PIC objects in the static library will cause linker errors. To avoid this, obey b_pie for static libraries if either b_staticpic=false or they use "pic: false". Without this patch, QEMU cannot use b_staticpic, which causes a slowdown on some QEMU benchmarks up to 20%.
* intro: Add extra_files key to intro output (fixes #7310)Daniel Mensinger2020-10-151-1/+1
|
* vs: add static_from_buildtype to b_vscrtPeter Harris2020-10-141-0/+7
|
* Add win_subsystem kwarg. Closes #7765.Jussi Pakkanen2020-10-072-3/+11
|
* Fixed using files object in subdir with xcode backendOskar Sigvardsson2020-10-041-1/+1
| | | | | Fixes bug #589. When generating string from file object, it didn't take subdir into account.
* pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger2020-10-043-5/+5
|
* compilers/swift: Add type annotationsDylan Baker2020-10-011-2/+2
|
* Merge pull request #7762 from jon-turney/meson-exe-output-improveJussi Pakkanen2020-09-293-24/+48
|\ | | | | Improve the output for meson wrapped commands
| * Make meson_exe report pickled command when it failsJon Turney2020-09-201-0/+1
| | | | | | | | | | Make 'meson --internal exe --unpickle' report the actual command executed when it fails, which is otherwise invisible.
| * Improve description of meson wrapped custom commandsJon Turney2020-09-203-24/+47
| | | | | | | | | | | | I've always found ninja reporting 'a meson_exe.py custom command' unclear and confusing. Instead say we are invoking a custom command, wrapped by meson, and why.
* | compilers/VS: fix build to use optimization and debug flagsVili Väinölä2020-09-292-10/+24
| | | | | | | | | | | | | | | | - Fixed using debug and optimization built-in options in MSVC. - Fixed that VS backend does not create pdb files in release mode. VS implicitly adds the debug fields if left out. - Fix that it is possible to add debug info with ninja backend with optimizations.
* | compilers/mixins/clike: fix mypy issuesDylan Baker2020-09-241-2/+5
|/
* pylint: Catch cases of `if len(container)` which should be replaced by `if ↵Dylan Baker2020-09-181-1/+1
| | | | | | | container` Unfortunately this doesn't catch other abuses of len(continauer) like, `len(container) <comparator> 0`, see: https://github.com/PyCQA/pylint/issues/3751
* Support identifying msvc dependency prefix with a path starting with a backslashMartin Storsjö2020-09-181-2/+7
|
* backends: Treat build target as generator only when it's the first argNirbheek Chauhan2020-09-173-5/+7
| | | | | Otherwise it might be an argument to a script that just inspects the binary itself.
* Allow installing dir from build dirXavier Claessens2020-09-131-1/+5
|
* Remove redudant checks in vs2010 backendVili Väinölä2020-09-131-6/+3
| | | | | - Implicit include dirs was checked twice in a row - Add define only if it does not yet exist rather than remove.
* Add VS include directories to projects as wellVili Väinölä2020-09-131-2/+3
| | | | | | - "Go To Document" action previously only worked on c/cpp files which had the include directories set but it was not possible to move from header to another header.
* Revert "Do not automatically set warning flags if buildtype is 'plain'"Eli Schwartz2020-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8ee1c9a07a3a35e3ed262fbc358fd86c257a966e. No rationale was given for this change prior to merging. After the fact it was described as desired by distro packagers, however as a distro packager I believe this commit hurts me. From a distro packaging perspective, we primarily care about one thing: previously building code should still build. Hence, -Werror is bad for our use case. meson handles this via -D werror which is different from -D warning_level and as long as the former is disabled, warnings in the build do not cause harm (but may attract review attention for upstream to fix). buildtype is a completely unrelated concern, and the intention for =plain is to disable debug or optimization settings that result in codegen differences and thus different built artifacts. This must not happen in distro builds because the *distributed programs* should conform to policy settings. Unfortunately, completely disabling warnings happens silently, and cannot be overridden even if you really, really believe you know what you're doing. It is thematically broken, since use of add_project_arguments() to add more -W flags is not likewise ignored. But if you try to add -Wall in that manner, meson will lecture you to use warning_level which you cannot do. And if you have custom warning flags which depend on options enabled by judicious use of -Wall via default_options: 'warning_level=1', then you end up with generated warnings complaining about your command line rather than your code, such as: cc1: warning: ‘-Wformat-y2k’ ignored without ‘-Wformat’ [-Wformat-y2k] cc1: warning: ‘-Wformat-extra-args’ ignored without ‘-Wformat’ [-Wformat-extra-args] cc1: warning: ‘-Wformat-zero-length’ ignored without ‘-Wformat’ [-Wformat-zero-length] cc1: warning: ‘-Wformat-contains-nul’ ignored without ‘-Wformat’ [-Wformat-contains-nul] cc1: warning: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Wformat-security] which then break the build with -Werror. Throughout all this, a buildtype of "plain" does *not* disable -D werror=true, which is the part where distro builds actually break down! Users who both wish to disable debug/optimization codegen, *and* disable warning commentary, are encouraged to do so by doing both, not by doing one and having the other be assumed. Fixes #7399
* minstall: Add version field to install dataNirbheek Chauhan2020-09-102-8/+4
| | | | | | | And check the install data in the same way that mtest checks serialisation data. Fixes https://github.com/mesonbuild/meson/issues/2354
* mtest: Check version in the test data after loadingNirbheek Chauhan2020-09-101-3/+4
| | | | | | | Same as coredata.dat and build.dat loading. Also, do not assert if things change. Raise the appropriate exception. Fixes https://github.com/mesonbuild/meson/issues/7613
* ninja: Generate all STATIC_LINKER rulesJon Turney2020-09-101-2/+5
| | | | | | | | | Don't stop generating STATIC_LINKER rules at the first MachineChoice which isn't available (i.e. generate a STATIC_LINKER rule, even if STATIC_LINKER_FOR_BUILD isn't needed) Also warn about internal errors which lead to non-existent rule references, rather than exploding with a KeyError.
* typing: more fixesDaniel Mensinger2020-09-083-10/+14
|
* backends: check external rpaths for all languages using ldflagsJames Hilliard2020-09-061-2/+2
| | | | Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
* Merge pull request #7689 from scivision/fortran_incJussi Pakkanen2020-09-061-20/+22
|\ | | | | correct Fortran include algorithm
| * fortran: make include scanning also work for CMake subprojectsMichael Hirsch2020-09-021-20/+22
| | | | | | | | | | | | | | also fixed PEP8 I originally implemented the "include" scanning, but hadn't made a test for this case
* | environment: use ExternalProgram to find ninjaPaolo Bonzini2020-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | This allows the NINJA environment variable to support all the Windows special cases, especially allowing an absolute path without extension. Based on a patch by Yonggang Luo. Fixes: #7659 Suggested-by: Nirbheek Chauhan <nirbheek@centricular.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | introspect: add test dependencies info to test/benchmark JSONPaolo Bonzini2020-09-041-2/+10
|/ | | | | | | | | | | | Add the ids of any target that needs to be rebuilt before running the tests as computed by the backend, to the introspection data for tests and benchmarks. This also includes anything that appears on the test's command line. Without this information, IDEs must update the entire build before running any test. They can now instead selectively build the test executable itself and anything that is needed to run it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* backends: do not look for extra paths unnecessarilyPaolo Bonzini2020-08-312-8/+6
| | | | | | | | | | | | | extra_paths only matter for the host machine if using an exe_wrapper. However, because CustomTarget.for_machine is always MachineChoice.HOST, they were computed unnecessarily in as_meson_exe_cmdline. Defer computation of extra_paths until after we have found out if the custom target executable is really for the host or the build machine, so that we can use exe_for_machine; for_machine then becomes unused and can be removed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Merge pull request #7607 from bonzini/speedupJussi Pakkanen2020-08-221-18/+23
|\ | | | | Various speedups from profiling QEMU's meson.build
| * ninjabackend: avoid lambdasPaolo Bonzini2020-08-181-3/+2
| | | | | | | | | | | | | | | | | | The lambda in NinjaBuildElement.write is quite expensive, totalling 0.3s just to do a couple function calls. Since it is used just once, simply inline it. On a QEMU build, the total time spent in write from this series goes from 5.321s to 3.238s, though part of it can be attributed to previous patches.
| * ninjabackend: optimize length_estimatePaolo Bonzini2020-08-181-10/+12
| | | | | | | | | | | | | | | | | | | | | | Optimize the regular expression so that the variable expansion part always ends up in group 1, and the trailer after the variable is discarded in the same match. Do not use re.sub to remove braces, and do not bother building the expanded command, just adjust the estimated length on the fly. functools.reduce is extremely slow, so I am keeping ' '.join(chunk). On a QEMU build the time spend in the function goes from 1.072s to 0.757s.
| * ninjabackend: optimize ninja_quotePaolo Bonzini2020-08-181-5/+9
| | | | | | | | | | | | Use regular expressions to quickly weed out strings that require quoting On a QEMU build the time spent in ninja_quote goes from 1.978s to 1.281s, with str.replace being kicked completely out of the profile.
* | Interpreter: Fix c_stdlib usageXavier Claessens2020-08-182-16/+11
|/ | | | | | | - Exceptions raised during subproject setup were ignored. - Allow c_stdlib in native file, was already half supported. - Eliminate usage of subproject variable name by overriding '<lang>_stdlib' dependency name.
* ninjabackend: Fix coverage rule generationNirbheek Chauhan2020-08-151-1/+1
| | | | | | | | | | Without the parenthesis, the command evaluates to `[]` if `use_llvm_cov` is `False`. Also fix tests to actually check whether or not coverage reports are generated. Fixes https://github.com/mesonbuild/meson/issues/7553
* Merge pull request #7494 from keszybz/fix-two-warningsJussi Pakkanen2020-07-301-3/+3
|\ | | | | Fix two warnings
| * Avoid warning about multiple outputs when building private directory nameZbigniew Jędrzejewski-Szmek2020-07-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixup for b4b1a2c5a145c1459fc4563a289e164e23bd6a02. A warning would be printed for any rule with multiple outputs, for example: WARNING: custom_target 'coredump.conf.5' has more than one output! Using the first one. WARNING: custom_target 'dnssec-trust-anchors.d.5' has more than one output! Using the first one. WARNING: custom_target 'halt.8' has more than one output! Using the first one. Fixes https://github.com/systemd/systemd/issues/16461.