aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/detect.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-09detect.py: Be more precise about detecting xtensa gcc toolchainsKhem Raj1-1/+1
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. Segovia1-0/+3
Fixes #11082
2022-12-27emscripten: remove no longer relevant commentKleis Auke Wolthuizen1-2/+1
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 Claessens1-27/+25
Only combine them in the Compiler base class, this will make easier to run compiler without ccache.
2022-10-24basic support for oneapi compilersRobert Cohn1-3/+35
2022-10-24Add MASM compilerXavier Claessens1-0/+42
ml and armasm are Microsoft's Macro Assembler, part of MSVC.
2022-10-24nasm: Harcode default path on WindowsXavier Claessens1-0/+4
NASM's installer does not add itself into PATH, even when installed by choco.
2022-10-24Add yasm as fallback for nasm languageXavier Claessens1-2/+6
2022-10-24Add NASM compilerXavier Claessens1-0/+31
2022-09-19pylint: enable use-maxsplit-argDylan Baker1-2/+2
This finds a bunch of places where we can do more efficient string splitting.
2022-09-19fix odd mypy issue in unreachable codeEli Schwartz1-0/+1
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 Schwartz1-1/+1
2022-09-19compilers: avoid importing compilers upfront for detectEli Schwartz1-114/+2
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 Schwartz1-86/+103
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 Schwartz1-7/+7
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 Schwartz1-12/+12
Preparation for future commit.
2022-09-19compilers: use consistent function signature for objcEli Schwartz1-7/+7
e.g. for detect_c_or_cpp we just take the language itself as an argument.
2022-09-19compilers: remove dead codeEli Schwartz1-1/+1
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 Schwartz1-18/+26
It's the style for most, but not all, of this file.
2022-07-25linkers: Add a representation for the Apple AR LinkerDylan Baker1-1/+2
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 Blanchard1-3/+3
work) based on host OS, not build OS.
2022-07-21compilers: add logging to obscure compiler defines scraperEli Schwartz1-2/+8
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 Schwartz1-0/+5
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 Schwartz1-25/+26
Use join_args to ensure that commands are rendered correctly.
2022-07-06Detect Cython and Vala compilers on the build machine alwaysTristan Partin1-4/+3
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 Nassyr1-28/+6
2022-06-10Allow for 3-component ACfL versionsStepan Nassyr1-8/+26
2022-05-23move various imports into TYPE_CHECKING blocks for neatnessEli Schwartz1-8/+10
2022-04-30linkers: Add support for mold linkerFini Jastrow1-30/+30
[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 Claessens1-1/+1
2022-03-22compilers: fix mypy warning in Rust detectionDylan Baker1-0/+1
2022-03-12remove unused type ignore that mypy 0.940 no longer needsEli Schwartz1-1/+1
And now that it doesn't need it, it errors out when you use it.
2022-02-16flake8: fix various whitespace errors with badly aligned codeEli Schwartz1-2/+1
2022-02-16flake8: remove some redundant separatorsEli Schwartz1-1/+1
2022-02-16flake8: fix typoed whitespace surrounding tokensEli Schwartz1-1/+1
2022-02-02Genericise TI compiler and add MSP430 supportWilliam Toohey1-16/+32
2022-01-27mark regex string as raw string to fix invalid escapesEli Schwartz1-2/+2
2022-01-27flake8: fix indentation styleEli Schwartz1-23/+23
2022-01-03armltdclang: add support for ARM Ltd.'s `armclang` toolchainBen Boeckel1-0/+28
This is another toolchain also called `armclang`, but it is not a cross compiler like Keil's `armclang`. It is essentially the same as `clang` based on its interface and CMake's support of the toolchain. Use an `armltd` prefix for the compiler ID. Fixes: #7255
2021-10-31Add 64-bit paths to check for unsupported Watcom cl.exe clones.William D. Jones1-1/+4
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-1/+1
2021-10-25Add sccache support.Jussi Pakkanen1-2/+7
2021-10-06Fix compiler detection for cl/clang-clJesse Natalie1-1/+1
If the compiler specified is a path to a compiler, the current detection is broken. It needs to use just the compiler name instead.
2021-10-04fix extra whitespaceEli Schwartz1-3/+0
discovered via flake8 --select E303
2021-09-29Fix mypy errorsmakise-homura1-5/+8
2021-09-29compilers: Select correct clang on e2k for C++ and ObjC++makise-homura1-2/+2
2021-09-29compilers: There is clang for e2k (elbrus) platform finallymakise-homura1-6/+4
2021-09-24compilers/rust: Add support for clippyDylan Baker1-8/+15
Clippy is a compiler wrapper for rust that provides an extra layer of linting. It's quite popular, but unfortunately doesn't provide the output of the compiler that it's wrapping in it's output, so we don't detect that clippy is rustc. This small patch adds a new compiler class (that is the Rustc class with a different id) and the necessary logic to detect that clippy is in fact rustc) Fixes: #8767
2021-09-24compilers/detect: use linker_always_args as well as linker exe_listDylan Baker1-1/+1
Otherwise we don't get critical arguments like -fuse=lld.
2021-09-24compilers/detect: avoid mutating rustc compiler listDylan Baker1-0/+2
Because mutation is bad.