aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2020-09-07Bump minimum supported Python version to 3.6. Closes #6297.pythonbumpJussi Pakkanen1-13/+2
2020-09-06backends: check external rpaths for all languages using ldflagsJames Hilliard2-2/+3
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-09-06Merge pull request #7689 from scivision/fortran_incJussi Pakkanen1-20/+22
correct Fortran include algorithm
2020-09-04environment: use ExternalProgram to find ninjaPaolo Bonzini7-18/+22
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>
2020-09-04introspect: add test dependencies info to test/benchmark JSONPaolo Bonzini2-2/+11
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>
2020-09-02fortran: make include scanning also work for CMake subprojectsMichael Hirsch1-20/+22
also fixed PEP8 I originally implemented the "include" scanning, but hadn't made a test for this case
2020-09-02symbolextractor: Handle PermissionError when running toolNirbheek Chauhan1-0/+5
I can't reproduce this, but it is definitely possible. In this case what we should do is the same as when the tool is not found. Fixes https://github.com/mesonbuild/meson/issues/7605
2020-09-02cmake: Don't link DEBUG to CRT when not building with MSVCNirbheek Chauhan1-1/+3
is_debug doesn't just control the CRT, it also controls the 'debug configuration' which is unrelated to the CRT setting on non-MSVC. Fixes https://github.com/mesonbuild/meson/issues/7631
2020-09-02interpreterbase: Fix typing annotationXavier Claessens1-1/+1
Co-authored-by: Daniel Mensinger <daniel@mensinger-ka.de>
2020-09-02Special case meson.version().version_compare() statementXavier Claessens2-3/+22
when that statement gets evaluated, the interpreter remembers the version target and if it was part of the evaluation of a `if` condition then the target meson version is temporally overriden within that if-block. Fixes: #7590
2020-09-02environment: do not raise exception in detect_cuda_compilerMatt Madison1-2/+0
when the compiler is not a string. When the compiler is set in the build configuration (required, for example, in a cross-build setup), the compiler setting is already a list, which is the desired type. Signed-off-by: Matt Madison <matt@madison.systems>
2020-09-02Add a notice about Python 3.5 supportNirbheek Chauhan2-4/+21
This will be printed in bold at the end of interactive meson sub-commands that won't be parsed by a program. Specifically: setup, compile, test, and install. NOTICE: You are using [...]
2020-09-02dependencies/mpi: add missing annotationDylan Baker1-3/+3
2020-09-02dependencies: Fix type of dependency_factory decoratorDylan Baker1-13/+11
There was both a straight up bug in the type signature (the return type is List[Callable[[], Dependency]] not List[Type[Dependency]]), and in the way the arguments are assembled. Typing is pretty limited in it's ability to express decorators, so the best mypy can do is check the return types (I think). I've done what the docs suggest and it's stopped complaining.
2020-08-31backends: do not look for extra paths unnecessarilyPaolo Bonzini2-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>
2020-08-31mcompile: Also support -v for verboseNirbheek Chauhan1-1/+1
This matches `meson test`, and there's really no other meaning that could be attributed to this, since you would call `meson` to get the version, not the `compile` sub-command.
2020-08-30CMake module: fix cmake 3.10 compatibility in path generationSebastian Würl1-4/+4
2020-08-30CMake module: fix python 3.6 compatibility in path generationSebastian Würl1-2/+2
2020-08-30CMake module: Allow paths of generated CMake sources for include directoriesSebastian Würl1-3/+11
2020-08-30Be stricter when detecting Windows/CygwinChristoph Reiter4-10/+8
This removes the check for "mingw" for platform.system(). The only case I know where "mingw" is return is if using a msys Python under a msys2 mingw environment. This combination is not really supported by meson and will result in weird errors, so remove the check. The second change is checking sys.platform for cygwin instead of platform.system(). The former is document to return "cygwin", while the latter is not and just returns uname(). While under Cygwin it uname() always starts with "cygwin" it's not hardcoded in MSYS2 and starts with the environment name. Using sys.platform is safer here. Fixes #7552
2020-08-30meson_exe: Remove two unused functionsChristoph Reiter1-9/+0
2020-08-30mcompile: use -v instead of --verbose for ninjaIgor Raits1-1/+1
The `--verbose` has been added to ninja in 1.9.0 and we pretend that we have compatibility with Ninja 1.7+. References: https://github.com/ninja-build/ninja/commit/bf7517505ad1def03e13bec2b4131399331bc5c4
2020-08-30Dedup final install rpath.Jussi Pakkanen1-6/+9
2020-08-30D: fix include orderPierrick Bouvier1-0/+7
Commit 93c3ec7e introduced a new way to handle deduplication with compiler args. This resulted in D includes to be reversed.
2020-08-27Fix typo when fetching buildtype option for compiler checksNirbheek Chauhan1-1/+1
This type happened in https://github.com/mesonbuild/meson/pull/7432 and wasn't noticed because I didn't add a test for it. Rectified now. If we don't specify the CRT, MSVC will pick /MT by default (!?) and link to `libcmt.lib`. This actually *breaks* UWP because `libcmt.lib` is not available by default when building for UWP. Was noticed here: https://github.com/cisco/libsrtp/pull/505
2020-08-25Merge pull request #7581 from peterh/aixJussi Pakkanen4-5/+65
Add AIX support
2020-08-25qt module: add qresource support to compile_translationsEli Schwartz1-11/+49
A common pattern in Qt5 applications is to embed translations in the executable using the qresource system. In this case, the list of translation files is already available in the .qrc file and there's no good reason to duplicate this info in meson.build. Let compile_translations optionally take a qrc input, in which case it will go straight to generating the relevant translations and rcc-generated .cpp, and directly return the thing users actually care about -- the .cpp for linking.
2020-08-23Merge pull request #7600 from alexrp/masterJussi Pakkanen2-3/+15
Add C2x option support.
2020-08-22Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clangJussi Pakkanen5-8/+41
Fix mapping of apple compilers in cmake
2020-08-22cmake: Fix detection of AppleClangDylan Baker1-6/+19
It's not enough to detect that the linker is ld64: gcc, icc, and vanilla clang all use ld64 on macoOS. Instead we have to detect the class of the compiler, and determine if it's an Apple Compiler or a vanilla one.
2020-08-22compilers: Add Apple subclasses for ObjC and ObjC++Dylan Baker4-2/+22
These are needed because in some cases we need to be able to know if we're using vanilla clang or Apple's clang.
2020-08-22Update LLVM tool versions for LLVM/Clang 10.Alex Rønne Petersen1-1/+2
2020-08-22Add C2x option support.Alex Rønne Petersen1-2/+13
2020-08-22Merge pull request #7607 from bonzini/speedupJussi Pakkanen5-31/+47
Various speedups from profiling QEMU's meson.build
2020-08-22Merge pull request #7447 from scivision/nvcJussi Pakkanen6-8/+74
Add support for NVidia HPC SDK compilers
2020-08-20interpreter: Do not get variable on failed subprojectXavier Claessens1-4/+9
Fixes: #7620
2020-08-20Correctly determine C++ stds for Elbrus compilermakise-homura1-5/+13
2020-08-20simplify shutil usage by invoking copy2 where appropriateEli Schwartz4-10/+5
It's equivalent to copyfile + copystat with the same arguments.
2020-08-18Interpreter: Fix c_stdlib usageXavier Claessens4-41/+37
- 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.
2020-08-18prevent disabler() object from overwriting arrays (#7484)Elliot1-4/+2
* prevent disabler object from overwriting arrays fixes #7107 * fix failing test forgot that func() != func(void) in c
2020-08-18clike: optimize to_nativePaolo Bonzini1-4/+8
Look for group-able flags with a single regex match, since we are already using regexes for .so files. Also weed out flags other than -isystem very quickly with a single startswith call. On a QEMU build, the time spent in to_native goes from 2.279s to 1.322s.
2020-08-18ninjabackend: avoid lambdasPaolo Bonzini1-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.
2020-08-18ninjabackend: optimize length_estimatePaolo Bonzini1-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.
2020-08-18build: optimize extract_objectsPaolo Bonzini1-1/+2
extract_objects is repeatedly looking up files in self.sources, which is a list. Convert it to a set beforehand so that the lookup is O(1). On a QEMU build, the time spent in extract_objects goes from 3.292s to 0.431s. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-18File: precompute hashPaolo Bonzini1-1/+4
Most files are going to be looked up into a set or dictionary. Precompute the hash so that we only need to do so once and we can also use it to quickly weed out unequal objects. On a QEMU build, the time spent in __eq__ and __hash goes respectively from 3.110s to 2.162s and from 0.648s to 0.299s. Even larger gains are obtained by the next patch.
2020-08-18ninjabackend: optimize ninja_quotePaolo Bonzini1-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.
2020-08-18arglist: optimize flush_pre_postPaolo Bonzini1-7/+10
pre_flush_set and post_flush_set are almost always empty, so we can use extend() instead of a for...in loop to add the previous elements of self._container. We can also skip the conversion from deque to list since pre_flush is always appended on the right side. On a QEMU build the time spent in flush_pre_post goes from 1.4 to 0.5 seconds.
2020-08-17find_library: include get_linker_always_args in link argsPeter Harris1-1/+1
The linker always args, as the name implies, should always be included. For example, the AIX get_allow_undefined_link_args are a syntax error unless the AIX get_linker_always_args are also used.
2020-08-15find_library: Print type of library not foundNirbheek Chauhan1-2/+7
If we can't find a static library, we should say that. It's confusing otherwise.
2020-08-15ninjabackend: Fix coverage rule generationNirbheek Chauhan1-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