aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
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-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
2020-08-13mtest: Actually call colorize_console()Nirbheek Chauhan1-1/+1
2020-08-12interpreter: Don't force fallback when subproject failed to configureXavier Claessens1-1/+2
Fixes: #7534
2020-08-12cmake: Use a mapping when writing compiler IDNirbheek Chauhan1-1/+26
Meson and CMake compiler ids are different. This commit adds a mapping from the meson list: https://mesonbuild.com/Reference-tables.html#compiler-ids to the CMake list: https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html The mapping is not 1-1, and not all entries are mapped, so this is a best-effort attempt. Fallback to GNU as before to try to limp along and hope that the build files don't rely on an accurate compiler ID.
2020-08-12cmake: Fix hard-coded values in fake CMakeLists for MSVCNirbheek Chauhan1-16/+28
Without this, MSVC and MSVC_VERSION won't be set by CMake during platform detection, and the compiler will be an undefined mixture of GNU and MSVC. In particular, find_package(opencv) will fail on Windows when building with MSVC.
2020-08-11Add h5cc shlib argument for correctly link hdf5 librariesWilliam F Godoy1-1/+2
respect "static" key in dependency function -shlib for static dependency -noshlib for static dependency
2020-08-09msvc: enable /std:c11 flagMichael Hirsch1-0/+20
2020-08-09cmake: Detect custom command targets in compiler argsDaniel Mensinger1-1/+8
This is required to make `-include /path/to/custom/target.hpp` work. This setup is used by wxWidgets and this PR is required to use wxWidgets as a CMake subproject.
2020-08-09cmake: Make the CMake targte not found error more useful (see #7567)Daniel Mensinger1-1/+3
2020-08-08Use uname -p to detect x86_64 on QNX.Elad Lahav2-1/+3
2020-08-07Better log message on rpath error.Jussi Pakkanen1-1/+2
2020-08-08mtest: fix skipping with various prefixesMarc-André Lureau1-1/+1
According to the specification: https://testanything.org/tap-specification.html#skipping-tests The harness should report the text after # SKIP\S*\s+ as a reason for skipping. (it's not exactly like the TODO directive, the phrasing/presentation of the spec could be improved).
2020-08-07cmake: make the traceparser permissive by default (fixes #7501)Daniel Mensinger1-1/+1
2020-08-07interpreter: Lower case languages before checking if 'c' is in the listXavier Claessens1-1/+1
Fixes: #7495
2020-08-07qt dependency: do not require all the tools automaticallyEli Schwartz1-5/+5
The compilers_detect function is only used in the qt module, which checks every time before using a specific compiler, if it is found. e.g. meson.build:10:6: ERROR: MOC sources specified and couldn't find moc-qt5, please check your qt5 installation In fact, the current check means we never even hit this error to begin with, because we previously died on the uninformative error: meson.build:10:6: ERROR: Program(s) ['moc'] not found or not executable which doesn't actually tell the user why this matters, and is all around a waste of time. Fixes #5582
2020-08-05Merge pull request #7527 from mensinda/cnFixExeJussi Pakkanen2-4/+16
cmake: resolve IMPORTED executables in custom commands (fixes #7509)
2020-08-05mtest: TestResult.SKIP is not a failure (#7525)Simon McVittie1-1/+1
* mtest: TestResult.SKIP is not a failure If some but not all tests in a run were skipped, then the overall result is given by whether there were any failures among the non-skipped tests. Resolves: https://github.com/mesonbuild/meson/issues/7515 Signed-off-by: Simon McVittie <smcv@debian.org> * Add test-cases for partially skipped TAP tests issue7515.txt is the output of one of the real TAP tests in gjs, which failed as a result of #7515. The version inline in meson.build is a minimal reproducer. Signed-off-by: Simon McVittie <smcv@debian.org>
2020-08-05cmake: Use the DEBUG config when linking to the debug CRTNirbheek Chauhan1-1/+4
The `debug` builtin option does not control whether or not the debug CRT is used. Without this fix, when buildtype=debugoptimized or when debug=true + b_vscrt=md, we will try to link to the debug libraries found via cmake while linking with `/release`, which will cause a link failure.
2020-08-05cmake: Do not split CMAKE_PREFIX_PATH with ':' on WindowsNirbheek Chauhan1-1/+6
This is obviously wrong, since on Windows ':' is in the drive letter. Causes us to call cmake with `-DCMAKE_PREFIX_PATH=c;\foo\bar`.
2020-08-04"Downgrade" warning when regenerating after version bumpZbigniew Jędrzejewski-Szmek2-3/+16
There is nothing to "warn" about, this is a completely routine occurence. OTOH, when something is corrupted, we should warn. Keep the red color and "WARNING:" prefix in that case. Example output: $ ninja -C build Regenerating configuration from scratch: Build directory has been generated with Meson version 0.55.999, which is incompatible with current version 0.56.0. The Meson build system Version: 0.56.0 ...
2020-08-04Capitalize some constants in coredataJohn Ericson4-18/+18
I've been getting confused between them and similarly-named other things, so I figured it was high time to clean this up.
2020-08-03cmake: resolve IMPORTED executables in custom commands (fixes #7509)Daniel Mensinger2-4/+16
2020-08-02Make meson recognize the Qualcomm LLVM toolchainAntony Chan3-2/+17
Meson calls `path/to/clang++ --version` to guess which build toolchain the user has picked to build the source code. For the Qualcomm LLVM toolchain, the output have an unusual output as shown below: ``` clang version 8.0.12 Snapdragon LLVM ARM Compiler 8.0.12 (based on llvm.org 7.0+) Target: arm-unknown-linux-gnueabi Thread model: posix Repository: (ssh://git-hexagon-aus.qualcomm.com:...) InstalledDir: /pkg/qct/software/llvm/release/arm/8.0.12/bin ``` Another unusual pattern is the output of `path/to/ld.qcld --version`: ``` ARM Linker from Snapdragon LLVM ARM Compiler Version 8.0.12 ARM Linker based on LLVM version: 8.0 ``` The Meson logic is modified accordingly so that Meson can correctly determine toolchain as "LLVM aarch64 cross-compiler on GNU/Linux64 OS". This is the expected output of `meson --native-file native_file.ini --cross-file cross_file.ini build/aarch64-debug/`: ``` ... C++ compiler for the host machine: ... (clang 8.0.12 "clang version 8.0.12") C++ linker for the host machine: ... ld.lld 8.0.12 ... ```
2020-08-01Put machine file and cmd line parsing in EnvironmentDylan Baker4-133/+179
This creates a full set of option in environment that mirror those in coredata, this mirroring of the coredata structure is convenient because lookups int env (such as when initializing compilers) becomes a straight dict lookup, with no list iteration. It also means that all of the command line and machine files are read and stored in the correct order before they're ever accessed, simplifying the logic of using them.
2020-08-01push all config-file settings into coredata.set_default_optionsDylan Baker1-37/+32
This puts all of them together, in the next patch they'll be pulled back out, but it's convenient to start that refactor by moving them all there, then moving them into env as a whole.
2020-08-01mesonlib: Add repr() methods to PerMachine classesDylan Baker1-0/+12
Which is super helpful in debuggers
2020-08-01machine-files: deprecate the paths sectionDylan Baker3-64/+7
2020-08-01coredata: fix type annotationDylan Baker1-1/+1
2020-08-01machine-files: give better error messages about using integersDylan Baker1-3/+9