summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/detect.py
AgeCommit message (Collapse)Author
2024-02-24compilers/detect: Implemented logic for checking suffixed LLVM tools before nondragonmux
2024-02-02fix UnboundLocalError if guess_win_linker fails in detect_fortran_compilerH. Vetinari
2024-01-26Differentiate message between dynamic linker and archiverDylan Baker
Currently both print `Detecting linker via`, which can be confusing. Clarifying this by printing "archiver" instead of "linker" for the static linker/archiver
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-12-11detect windows linkers for flang in detect_fortran_compilerH. Vetinari
2023-12-01More robust linker detection for armar (TI vs non-TI)Will Toohey
2023-09-01compilers: fix compiler detection when the "ccache" string is in the pathFilipe Laíns
Signed-off-by: Filipe Laíns <lains@riseup.net>
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-07-12compilers: detect cython version on stdout for newer cython versionsEli Schwartz
Cython historically, when asked to print the version and exit successfully, would do so on stderr, which is weird and inconsistent. Recently, it fixed this UX bug by printing on stdout instead: https://github.com/cython/cython/issues/5504 This then broke meson detection because we assumed it was on stderr due to historically being there: https://github.com/scipy/scipy/issues/18865 Cython is right, and shouldn't have to revert this reasonable change for backwards compatibility. Instead, check both.
2023-06-26linkers: delay implementations import until detect is runEli Schwartz
This saves on a 1500-line import at startup and may be skipped entirely if no compiled languages are used. In exchange, we move the implementation to a new file that is imported instead. Followup to commit ab20eb5bbc21ae855bcd211131132d2778602bcf.
2023-06-19compilers: don't recommend deprecated env varAlyssa Ross
RUST_LD was deprecated in Meson 0.54 in favor of RUSTC_LD.
2023-06-14compilers: fix detection of ifx compilerEli Schwartz
The version output scraping for identifying strings checked for "IFORT" in parentheses after the executable name, which is probably a mistake by Intel. Current versions of ifx have "IFX" in parentheses there. Detect both. Fixes #11873
2023-06-14compilers: add logging for non c_or_cpp language detectionEli Schwartz
2023-06-14WIP: refactor loggable popen calls for consistencyEli Schwartz
2023-05-13During reconfigure, show that no compiler was found, if compiler fails ↵Volker Weißmann
sanity check.
2023-05-06Initial support for Metrowerks AssemblerNomura
2023-04-24Initial support for Metrowerks C/C++ compilerNomura
2023-04-14rust: Use the corresponding rustc version when clippy-driver is chosen as ↵Sebastian Dröge
Rust compiler By default clippy-driver will report its own version, which is not very useful to check the toolchain version. Instead make sure to extract the actual toolchain version here.
2023-04-11fix various spelling issuesJosh Soref
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-03-09detect.py: Be more precise about detecting xtensa gcc toolchainsKhem Raj
clang --version can yield a string like below when its installed into such a directory clang version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9) Target: aarch64-yoe-linux Thread model: posix InstalledDir: /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-text-editor/42.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux as you can see InstallDir has 'xt-' subtring and this trips the check to guess gcc if 'Free Software Foundation' in out or 'xt-' in out: Therefore, check if compiler output starts with xt- then assume it to be gcc Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-20nasm: Detect and use MSVC linker if presentL. E. Segovia
Fixes #11082
2022-12-27emscripten: remove no longer relevant commentKleis Auke Wolthuizen
This was fixed in Emscripten 1.39.16, see: https://github.com/emscripten-core/emscripten/commit/d4fabf3da40e7f556700b16950739d5960a91559
2022-10-25Compilers: Keep ccache and exelist separatedXavier Claessens
Only combine them in the Compiler base class, this will make easier to run compiler without ccache.
2022-10-24basic support for oneapi compilersRobert Cohn
2022-10-24Add MASM compilerXavier Claessens
ml and armasm are Microsoft's Macro Assembler, part of MSVC.
2022-10-24nasm: Harcode default path on WindowsXavier Claessens
NASM's installer does not add itself into PATH, even when installed by choco.
2022-10-24Add yasm as fallback for nasm languageXavier Claessens
2022-10-24Add NASM compilerXavier Claessens
2022-09-19pylint: enable use-maxsplit-argDylan Baker
This finds a bunch of places where we can do more efficient string splitting.
2022-09-19fix odd mypy issue in unreachable codeEli Schwartz
This used to be fine, until imports were removed from this file. Now a function annotated as T.NoReturn doesn't actually tell mypy that it cannot return, though, so we manually do it.
2022-09-19simplify type annotationEli Schwartz
2022-09-19compilers: avoid importing compilers upfront for detectEli Schwartz
We no longer need these upfront at all, since we now import the ones we need for the language we are detecting, at the time of actual detection. This avoids importing 28 files, consisting of just under 9,000 lines of code, at interpreter startup. Now, it is only imported depending on which languages are invoked by add_languages, which may not even be anything. And even if we do end up importing a fair chunk of it for C/C++ projects, spreading the import cost around the interpreter runtime helps responsiveness.
2022-09-19compilers: perform targeted imports for detectEli Schwartz
Only import the ones we need for the language we are detecting, once we actually detect that language. This will allow finally dropping the main imports of these files in a followup commit.
2022-09-19compilers: use more direct checks for what kind of compiler we haveEli Schwartz
Instead of comparing against specific compiler classes, check the logical compiler id or language etc. In a couple cases, we seem to be missing a couple things by being a bit too strict about the exact class type.
2022-09-19compilers/detect: rename potentially conflicting nameEli Schwartz
Preparation for future commit.
2022-09-19compilers: use consistent function signature for objcEli Schwartz
e.g. for detect_c_or_cpp we just take the language itself as an argument.
2022-09-19compilers: remove dead codeEli Schwartz
It doesn't matter whether the language is c or cpp, xc16 only has a C compiler so that's what this has to be.
2022-09-19compilers: single-source compiler class as cls, consistentlyEli Schwartz
It's the style for most, but not all, of this file.
2022-07-25linkers: Add a representation for the Apple AR LinkerDylan Baker
Which is old and annoying and doesn't expose global symbols by default, so we need a work around. see: https://github.com/mesonbuild/meson/pull/10587 see: https://lists.gnu.org/archive/html/libtool/2002-07/msg00025.html
2022-07-21ar linker: detect the "osx ld" case (where generating thin archives won't ↵Justin Blanchard
work) based on host OS, not build OS.
2022-07-21compilers: add logging to obscure compiler defines scraperEli Schwartz
If this command fails, for example when CXX is something not generic enough to be a valid universal compiler command (clang -std=c++11 perhaps), we end up with two problems: - it's impossible to figure out what Meson ran to get that error - the error report isn't clear on what is stdout and what is stderr, or even that that is what the message is about. ``` meson.build:1:0: ERROR: Unable to get clang pre-processor defines: error: invalid argument '-std=c++11' not allowed with 'C' ``` What's C doing there and why is Meson talking about it? Answer: that's compiler stdout. Say so.
2022-07-21compilers: include compiler detection output in the debug logsEli Schwartz
We do something similar when running get_compiler() method checks from the DSL. This ensures that if errors happen, the log file we tell people to check actually works.
2022-07-21compilers: better reporting of command failuresEli Schwartz
Use join_args to ensure that commands are rendered correctly.
2022-07-06Detect Cython and Vala compilers on the build machine alwaysTristan Partin
Transpilers need to run on the build machine in order to generate their output, which can then be taken by a cross-compiler to create the final output.
2022-06-10ACfL version detection with regexStepan Nassyr
2022-06-10Allow for 3-component ACfL versionsStepan Nassyr
2022-05-23move various imports into TYPE_CHECKING blocks for neatnessEli Schwartz
2022-04-30linkers: Add support for mold linkerFini Jastrow
[why] Support for the relatively new mold linker is missing. If someone wants to use mold as linker `LDFLAGS="-B/path/to/mold"` has to be added instead of the usual `CC_LD=mold meson ...` or `CXX_LD=mold meson ...`. [how] Allow `mold' as linker for clang and newer GCC versions (that versions that have support). The error message can be a bit off, because it is generic for all GNU like compilers, but I guess that is ok. (i.e. 'mold' is not listed as possible linker, even if it would be possible for the given compiler.) [note] GCC Version 12.0.1 is not sufficient to say `mold` is supported. The expected release with support will be 12.1.0. On the other hand people that use the un-released 12.0.1 will probably have built it from trunk. Allowing 12.0.1 is helping bleeding edge developers to use mold in Meson already now. Fixes: #9072 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-03-24Debian renamed cython to cython3, support bothXavier Claessens
2022-03-22compilers: fix mypy warning in Rust detectionDylan Baker