aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)AuthorFilesLines
2021-10-31Add 64-bit paths to check for unsupported Watcom cl.exe clones.William D. Jones1-1/+4
2021-11-01migrate python 3.5 compatible superclass variable annotations to 3.6Eli Schwartz1-5/+3
As we now require python 3.6, we can declare their types without initializing them.
2021-11-01Revert "known Python 3.5 on windows workaround for subprocess(cwd=str(Path))"Eli Schwartz1-2/+1
This reverts commit c89aa2094170b2ffd7151187c1c092db2a178f44. We no longer support 3.5 so this can go.
2021-10-29Remove duplicated CEXE_MAPPING tableXavier Claessens1-5/+0
2021-10-27fix various flake8 whitespace errorsEli Schwartz9-22/+22
2021-10-25Add sccache support.Jussi Pakkanen1-2/+7
2021-10-24Add stdc++20 support for Visual Studio 2019 v16.11Moroz Oleg1-0/+4
fix #9242
2021-10-21compilers/rust: fix typo in standard descriptionDylan Baker1-1/+1
2021-10-21compilers/rust: add support for the 2021 editionDylan Baker1-1/+1
2021-10-14cuda: Override std=none to avoid host_compiler to emit -std argumentXavier Claessens1-6/+3
2021-10-10Fix typos discovered by codespellChristian Clauss7-16/+16
2021-10-07clike compilers: drop semicolon at function endVladimír Čunát1-4/+4
warning: ISO C does not allow extra ';' outside of a function [-Wpedantic]
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 Schwartz5-9/+0
discovered via flake8 --select E303
2021-10-04use idiomatic python for membership testsEli Schwartz1-1/+1
"X not in Y" is preferred over "not X in Y", as the former is more readable.
2021-09-29Fix mypy errorsmakise-homura2-5/+9
2021-09-29compilers/elbrus: Deal with C/C++/Fortran stds more correctlymakise-homura4-14/+43
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-29compilers/elbrus: Support prelinking with lcc correctlymakise-homura1-0/+3
2021-09-29compilers/elbrus: Fix incorrect inheritance model of Elbrus*Compilermakise-homura4-13/+14
2021-09-28Merge pull request #9014 from bonzini/mixed-language-linkJussi Pakkanen2-8/+22
Use appropriate compiler for the source file for "links" tests with file argument
2021-09-25Merge pull request #8773 from dcbaker/submit/rustc-enhancements-clippyJussi Pakkanen3-10/+65
More enhancements for Rust + clippy support
2021-09-24compilers/rust: Add support for clippyDylan Baker3-9/+34
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-24rustc: implement pic argsDylan Baker1-0/+9
2021-09-24compilers/rust: Implement warning levelsDylan Baker1-0/+14
Currently this implements 3 warning levels, 1 and 2 are just the "default" set by rustc, 3, is "everything is a warning", and 0 is "nothign is a warning".
2021-09-24rust: Add werror argumentsDylan Baker1-0/+5
2021-09-24compilers/detect: avoid mutating rustc compiler listDylan Baker1-0/+2
Because mutation is bad.
2021-09-25compilers: Add default search path stdlib_only_link_flagsDylan Baker3-12/+60
This should be done in all cases of language_stdlib_only_link_flags, but I don't have access to all of the compilers to test it. This is required in cases where object files created by gfortran are linked using another compiler with a differen default search path, such as gfortran and clang together.
2021-09-24Merge pull request #9167 from dcbaker/submit/meson-main-type-checkingJussi Pakkanen2-2/+3
Add type annotations and type checking to meson main
2021-09-24Add option to to transpile Cython to C++Dylan Baker1-0/+8
This patch adds a new meson built-in option for cython, allowing it to target C++ instead of C as the intermediate language. This can, of course, be done on a per-target basis using the `override_options` keyword argument, or for the entire project in the project function. There are some things in this patch that are less than ideal. One of them is that we have to add compilers in the build layer, but there isn't a better place to do it because of per target override_options. There's also some design differences between Meson and setuptools, in that Meson only allows options on a per-target rather than a per-file granularity. Fixes #9015
2021-09-24pylint: check for duplicate importsDylan Baker2-2/+3
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
2021-09-21Use -Oz when optimization=s in ClangAndrea Pappacoda1-1/+1
-Oz is the appropriate flag to use when you want to produce the smallest possible binary, and is one would expect when setting optimization to s or using the minsize build type.
2021-09-20compilers: Use standards compliant testRohit Goswami1-1/+1
2021-09-16C2000: Added depfile generation for incremental buildsmiebka1-0/+3
2021-09-14apply flake8 fixes for unused imports and missing importsEli Schwartz3-9/+3
2021-09-14compilers: publicly export one more constantEli Schwartz1-0/+1
It is imported from a subpackage in __init__ alongside a big list of other things which are all exported. And elsewhere, this import is re-imported by other code. It's pretty clearly an oversight that it didn't get added to __all__
2021-09-10nagfor preprocessor flag.Mat Cross1-0/+3
2021-09-10Comments on nagfor options setup.Mat Cross1-0/+1
2021-09-10Implemented some missing operation for the NAG Fortran Compiler.Mat Cross2-5/+27
2021-09-10objc/objcpp compiler: accept all gnu stds corresponding to c/c++ stdsEli Schwartz2-2/+2
The clang compiler now reimplements and re-checks the c_std and cpp_std options in order to use them for objc as well, but it didn't consistently support the same options. First it completely excluded all the gnu ones, and then it added a handful of them but not for C++. Be fully consistent -- or at least as consistent as we can be, given a minimally working fix. (The C/C++ compiler mixin actually gates different stds depending on detected clang version, we do not do that here.) Fixes regression in c54dd63547b030e3d9feee694ec6f49c434f0df8 Fixes incomplete fix from #8766 (which didn't fix objcpp at all) Fixes #9237
2021-09-07interpreter: detect and pass compiler to be used for linker testsPaolo Bonzini2-0/+4
Allow using the links method to test that the C++ driver (e.g. g++) can be used to link C objects. One usecase is that the C compiler's libsanitizer might not be compatible with the one included by the C++ driver. This is theoretically backwards-incompatible, but it should be treated as a bugfix in my opinion. There is no way in Meson to compile a .c file with the C++ driver as part of a build target, therefore there would be no reason to do something like meson.get_compiler(meson.get_compiler('cpp').links(files('main.c')). Fixes: #7703
2021-09-07compilers: allow link tests to use objects from a different compilerPaolo Bonzini1-2/+12
In some cases, link tests would like to use objects provided by a compiler for a different language, for example linking a C object file with a C++ compiler. This kind of scenario is what link_language is for, but it is impossible to test that it works with a linker test. This patch implements the required support in the Compiler class. The source code compiler is passed to the Compiler.links method as an argument.
2021-09-07compilers: do accept None in Compiler.compile extra_argsPaolo Bonzini1-1/+2
The type information allows it, but it is not actually handled.
2021-09-07compilers: fix flake8 issuesPaolo Bonzini1-7/+6
2021-09-04Support for appleframeworks with GCC and IntelEvan Miller1-3/+1
Fixes #8792 Fixes #8733
2021-09-01Clang should error for all implicit function checks (#9165)Dylan Baker2-3/+8
* compilers: improve docstring to `get_compiler_check_args()` There was an incomplete list, which wasn't useful as it now takes an enum anyway. Also add a new entry to the list of reasons to use this function. * clang: Add -Werror=implicit-function-declarations to check_args Unlike GCC, clang warns but doesn't error when an implicit function declaration happens. This means in checks like `compiler.has_header_symbol('string.h', 'strlcat')` (on Linux, at least) that GCC will fail, as there is no such function; clang will emit a warning, but since it exists with a 0 status Meson interprets that as success. To fix this, add `-Werror=implicit-function-declarations` to clang's check arguments. There seems to be something specific about functions that _may_ exist in a header on a given system, as `cc.has_header_symbol('string.h', 'foobar')` will return false with clang, but `strlcat` will return true, even though it's not defined. It is however, defined in some OSes, like Solaris and the BSDs. Fixes #9140
2021-09-01msvc: Assume UTF8 source by defaultXavier Claessens1-2/+11
Currently every project that uses UTF8 for its source files must add '/utf-8' argument otherwise they don't work non-English locale MSVC. Since meson.build itself is assumed to be UTF8 by default, seems better to assume it for source files by default too. For example: - https://gitlab.freedesktop.org/gstreamer/gst-build/-/blob/master/meson.build#L62 - https://gitlab.gnome.org/GNOME/glib/-/blob/main/meson.build#L29
2021-08-31pylint: turn on superflous-parensDylan Baker4-7/+7
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.