aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)AuthorFilesLines
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.
2021-08-22Add Java moduleTristan Partin1-4/+5
The Java module will serve as a source for easing Java development within Meson. Currently it only supports generating native header files.
2021-08-20compilers: Add get_no_warn_args to the base Compiler classDylan Baker1-0/+4
Because it should be defined there.
2021-08-16compilers/compilers: Fix some potential issues spotted by pyrightDylan Baker1-2/+4
There are two changes here, one is to remove an `elif` that is effectively an `else`, that helps the type checker and provides a small speedup potentially. The second is a potentially unbound variable, that currently isn't hit, but very much could be.
2021-08-16compilers: Fix extra_args parameterDylan Baker6-31/+36
which can also be a callable taking a CompileChekcMode as an argumetn and returning a list of strings.
2021-08-16compilers: Fix annotations for run and cached_compileDylan Baker2-6/+6
Which absolutely should accept `str | File`, but the annotations claim that only strings are accepted.
2021-08-15Revert "compilers/c++: Add MSVC option to make the __cplusplus define accurate"Jussi Pakkanen1-11/+0
This reverts commit 0b97d585480e973d8b149618901f7a4ddfa1a906.
2021-08-11compilers/c++: Add MSVC option to make the __cplusplus define accurateDylan Baker1-0/+11
Otherwise it always returns the value for c++98, starting with MSVC 2017 15.7 or later. Earlier versions are not affected by this mis-feature
2021-08-08Add support for finding Javascript source libraries with Emscripten.Jussi Pakkanen2-1/+36
2021-07-25C2000 compiler also accepts *.cla filesmiebka1-2/+4
2021-07-18Cuda: Enable PGODavid Seifert1-0/+6
2021-07-18Cuda: Filter -isystem with system pathsDavid Seifert1-12/+19
2021-07-18Cuda: Pass -DNDEBUG throughDavid Seifert1-0/+3
2021-07-14linkers: remove is_shared_module argument to get_soname_argsPaolo Bonzini4-12/+7
The argument is now unused, drop it.
2021-07-13Clang: Apply `-O0`Pamplemousse1-1/+1
Fix #8986
2021-07-06Fix unsupported linker error messageAndrea Pappacoda1-1/+1
An `f` was dropped in bd6f46e723813dfadaba1f7c87d3b0b751d05219
2021-07-05condense linesEli Schwartz3-10/+5
2021-07-05simplify mesonlib imports for the sake of line lengthsEli Schwartz1-7/+7
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz5-16/+14
2021-07-01C2000: linker uses now binary setting defined within the cross-filemiebka1-1/+1
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger9-10/+10
2021-06-27Update detect.pyIan Harvey1-1/+1
Adjust Intel Fortran compiler detection to handle changes in ifort logo with the introduction of the oneapi toolkit. See #8338.
2021-06-25typing: Annotate compilers.detectDaniel Mensinger1-62/+73
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger3-4/+1243
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
2021-06-22Fixed style issue as per comments on PR 8911.Justin Handville1-2/+1
2021-06-22Fix for Issue 8910 (Meson filters CMake asm files)Justin Handville1-0/+3
2021-06-18holders: Introduce HoldableObjectDaniel Mensinger1-3/+4
2021-06-18interpreter: Refactor interpreter.compiler to use ObjectHolderDaniel Mensinger1-0/+2
2021-06-09compilers: Fix missing functions in Compiler base classDaniel Mensinger3-5/+19
2021-06-07upgrade percent formatted strings pyupgrade did not catchEli Schwartz2-16/+14
2021-06-07condense linesEli Schwartz1-8/+4
2021-06-07more f-strings everywhereEli Schwartz1-73/+57
pyupgrade didn't catch many .format() methods which were too complex (e.g. multiline or applied to templates rather than string literals)
2021-06-07cython: Add an option for selecting python 3 vs python 2 outputDylan Baker1-3/+21