summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
Commit message (Collapse)AuthorAgeFilesLines
* backends: check external rpaths for all languages using ldflagsJames Hilliard2020-09-061-2/+2
| | | | Signed-off-by: James Hilliard <james.hilliard1@gmail.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-311-7/+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>
* Interpreter: Fix c_stdlib usageXavier Claessens2020-08-181-1/+1
| | | | | | | - 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.
* 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.
* | backends: fix rpath match patternJames Hilliard2020-07-301-2/+28
|/ | | | | | | | | | Since -Wl,-rpath= is not the only valid rpath ldflags syntax we need to try and match all valid rpath ldflags. In addition we should prevent -Wl,--just-symbols from being used to set rpath due to inconsistent compiler support. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
* compilers: Return CompilerArgs from compiler instanceDylan Baker2020-06-221-2/+1
| | | | | | | Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method.
* compilers: Split CompilerArgs into a separate moduleDylan Baker2020-06-221-1/+1
| | | | | I've also moved this out of the compilers pacakge because we're soon going to need it in linkers, and that creates some serious spagetti
* windows: Canonicalize `:` in filenamesNirbheek Chauhan2020-06-141-1/+7
| | | | Fixes https://github.com/mesonbuild/meson/issues/7265
* Include the dep itself in extra_paths for WindowsJon Turney2020-06-131-0/+1
| | | | | | | | | This is needed in the case where a custom_target directly depends on a shared library, and somehow loads it. (Specifically this can be the case with gtkdoc, when it invokes gtkdoc-scangobj, which will build and run it's own code to load a shared library, to introspect it)
* Handle multiple substitutions in eval_custom_target_command()Jon Turney2020-06-131-29/+30
| | | | | | | | | | | | | | | | Handle command arguments which contain multiple substitutions correctly in Backend.eval_custom_target_command() In particular, gnome.gtkdoc() makes arguments of the form '--cflags -I@SOURCE_ROOT@ -I@BUILD_ROOT' (where these arguments are then passed down to a compiler invocation) Normally, these are subsequently made right by NinjaBackend.replace_paths(), but if Backend.as_meson_exe_cmdline() decides that the command needs to be pickled, that doesn't happen. (Although having two places where this substitution might happen smells really bad)
* backend: There is no need for 'compiler-specific escaping' anymoreJon Turney2020-06-051-23/+7
| | | | | | | | | | Now that all command-line escaping for ninja is dealt with in the ninja backend, escape_extra_args() shouldn't need to do anything. But tests of existing behaviour rely on all backslashes in defines being C escaped: This means that Windows-style paths including backslashes can be safely used, but makes it impossible to have a define containing a C escape.
* Merge pull request #5986 from dcbaker/fix-tests-with-cross-binary-argumentsJussi Pakkanen2020-05-191-2/+21
|\ | | | | Fix tests with cross binary arguments
| * backends: Consider arguments passed to a test when cross compilingDylan Baker2020-05-181-2/+16
| | | | | | | | | | | | | | | | Otherwise a wrapper script which takes an executable as an argument will mistakenly run when that executable is cross compiled. This does not wrap said executable in an exe_wrapper, just skip it. Fixes #5982
| * backends: ensure that test executables can be run when passed as argumentsDylan Baker2020-05-181-0/+5
| | | | | | | | | | | | | | | | | | If an executable is passed as an argument to a script in the build directory that it resides in then it will not execute (on *nix) due to a lack of ./. Ie, `foo` must be called as `./foo`. If it is called from a different directory it will work. Ie `../foo` or `bar/foo`. Fixes #5984
* | Build private directory name from output file name.Jussi Pakkanen2020-05-191-1/+1
|/
* Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen2020-05-181-6/+27
|\ | | | | Let .pc files and LDFLAGS provide rpaths.
| * Let LDFLAGS specify rpath.Dan Kegel2020-05-161-0/+18
| | | | | | | | Fixes #2567
| * Let .pc files specify rpath.Dan Kegel2020-05-161-6/+9
| | | | | | | | Fixes #4027
* | Fix outdated cross-compilation checksOle André Vadla RavnÄs2020-05-131-1/+1
|/
* Merge pull request #7064 from dcbaker/gtest-protocolJussi Pakkanen2020-05-061-15/+46
|\ | | | | Add support for Gtest as a test protocol
| * Add native support for gtest testsDylan Baker2020-05-041-0/+5
| | | | | | | | | | | | | | | | Gtest can output junit results with a command line switch. We can parse this to get more detailed results than the returncode, and put those in our own Junit output. We basically just throw away the top level 'testsuites' object, then fixup the names of the tests, and shove that into our junit.
| * backend/backends: Fix type annotationDylan Baker2020-04-301-1/+1
| |
| * Convert test protocol into an enumDylan Baker2020-04-301-4/+26
| | | | | | | | | | This gives us better type safety, and will be important as we add more test methods
| * backends/backends: sort and cleanup importsDylan Baker2020-04-301-10/+14
| |
* | rm python2 %s from backends.py and ninjabackend.pyMichael Brockus2020-05-031-6/+6
|/
* Compiler options per langJohn Ericson2020-04-201-7/+10
| | | | | | | | | | | A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
* backend: Fix file name confilcts by using the complete pathDaniel Mensinger2020-04-161-2/+2
|
* Handle BuildTarget as custom_target() argument #6914Marc-André Lureau2020-04-111-9/+9
|
* Make werror per subproject optionXavier Claessens2020-03-241-1/+1
|
* Fix legacy env var support with crossJohn Ericson2020-03-231-1/+1
| | | | Fix #3969
* Make use of unholderDylan Baker2020-03-051-13/+5
| | | | | | | | | | We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
* Add unity block size option.Jussi Pakkanen2020-02-121-15/+30
|
* backends: Remove unused methodXavier Claessens2020-02-061-4/+0
|
* mintro: use interpreter data for buildsystem-files (fixes #6390)Daniel Mensinger2020-01-281-6/+0
|
* backend: refactor: set self.interpreter in the constructorDaniel Mensinger2020-01-281-9/+11
|
* Check for bad timestamps that cause eternal configure loops.Jussi Pakkanen2020-01-271-0/+17
|
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-7/+7
|
* Remove duplicated object files in static librariesXavier Claessens2019-10-211-1/+2
| | | | | | | | | When a static library link_whole to a bunch of other static libraries, we have to extract all their objects recursively. But that could introduce duplicated objects. ar is dumb enough to allow this without error, but once the resulting static library is linked into an executable or shared library, the linker will complain about duplicated symbols.
* Fix *.pdb files missing in meson introspect --installed outputJakub Adam2019-10-091-16/+25
| | | | | On Windows, make sure the introspect command lists all Program database (PDB) files containing debugging information that Meson will install.
* backends: Add needs_exe_wrapper to test serializationDylan Baker2019-09-281-2/+4
| | | | We need to know if the test actually needs an exe wrapper to run or not.
* CUDA support on WindowsAleksey Gurtovoy2019-09-241-24/+2
|
* Fix static archives stripping (#5905)David Seifert2019-09-081-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | * Do not strip static archives Stripping static archives without more fine-grained options (e.g. `-g`) leads to failures such as ld: libfoo.a: error adding symbols: archive has no index; run ranlib to add one because GNU strip removes *every* symbol in a static archive by default. Given that static archives are not final build artifacts (unlike executables and shared libraries), stripping them gains little and only causes more edge case failures. * Gentoo's portage only strips debug information: https://github.com/gentoo/portage/blob/86f211e3a552753eb945670a39c1a3b14c3c3bd1/bin/estrip#L322 * Fedora also only strips debug information: https://github.com/rpm-software-management/rpm/blob/e9c13c6565cf4782d1f73255ee9144dd9bd2aca7/scripts/brp-strip-static-archive#L18 * Debian also only does some very light stripping: https://github.com/Debian/debhelper/blob/72ed1d3261730d56da6afde0ec7f52f32976e04d/dh_strip#L374 Fixes #4138 * Add test case for static archive stripping
* Add test priorities to force test start orderPeter Hutterer2019-08-241-3/+5
|
* Vs backend compiler selection (#5448)Dylan Baker2019-08-241-0/+1
| | | | | | | | | | | | | | | | | | * backends/vs: Only set platform_toolset if it isn't already set * interpreter: set backend up after the compiler Otherwise we won't be able to check which VS toolchain to use. * docs/using-visual-studio: wrap lines * docs: recommend the py launcher instead of python3 for windows * set backend.environment when building a dummy version * backends/vs: Add support for clang-cl with vs2017 and vs2019 backends * backends/vs: Add support for ICL (19.x) with vs2015 and vs2017 backends
* Make .extract_objects() work correctly as an input to custom_targetRachel Mant2019-08-171-0/+2
|
* backends: do not split command and arguments in ExecutableSerialisationPaolo Bonzini2019-07-191-3/+2
| | | | | This is not needed anymore, just make a single field with the whole command line.
* backends: remove unnecessary fields from ExecutableSerialisationPaolo Bonzini2019-07-191-9/+5
| | | | | | | | | | | "exe.is_cross and exe.needs_exe_wrapper" is the same condition under which meson chooses whether to include the exe_wrapper. meson_exe has an assertion for that, but now that meson_exe does not need anymore exe.is_cross, we can simplify the code if we just "trust" meson to do the right thing. Remove both fields from ExecutableSerialisation and just test the presence of the wrapper, and also remove the executable basename which is only used to "beautify" an assertion failure.
* backends: discover java/mono wrapper at generation timePaolo Bonzini2019-07-191-0/+4
| | | | | | | Move the magic to execute jar and .exe files from "meson --internal exe" to the backend, so that "ninja -v" shows more clearly what is happening. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>