summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)Author
2021-09-21Use -Oz when optimization=s in ClangAndrea Pappacoda
-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 Goswami
2021-09-16C2000: Added depfile generation for incremental buildsmiebka
2021-09-14apply flake8 fixes for unused imports and missing importsEli Schwartz
2021-09-14compilers: publicly export one more constantEli Schwartz
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 Cross
2021-09-10Comments on nagfor options setup.Mat Cross
2021-09-10Implemented some missing operation for the NAG Fortran Compiler.Mat Cross
2021-09-10objc/objcpp compiler: accept all gnu stds corresponding to c/c++ stdsEli Schwartz
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 Bonzini
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 Bonzini
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 Bonzini
The type information allows it, but it is not actually handled.
2021-09-07compilers: fix flake8 issuesPaolo Bonzini
2021-09-04Support for appleframeworks with GCC and IntelEvan Miller
Fixes #8792 Fixes #8733
2021-09-01Clang should error for all implicit function checks (#9165)Dylan Baker
* 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 Claessens
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 Baker
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 Partin
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 Baker
Because it should be defined there.
2021-08-16compilers/compilers: Fix some potential issues spotted by pyrightDylan Baker
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 Baker
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 Baker
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 Pakkanen
This reverts commit 0b97d585480e973d8b149618901f7a4ddfa1a906.
2021-08-11compilers/c++: Add MSVC option to make the __cplusplus define accurateDylan Baker
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 Pakkanen
2021-07-25C2000 compiler also accepts *.cla filesmiebka
2021-07-18Cuda: Enable PGODavid Seifert
2021-07-18Cuda: Filter -isystem with system pathsDavid Seifert
2021-07-18Cuda: Pass -DNDEBUG throughDavid Seifert
2021-07-14linkers: remove is_shared_module argument to get_soname_argsPaolo Bonzini
The argument is now unused, drop it.
2021-07-13Clang: Apply `-O0`Pamplemousse
Fix #8986
2021-07-06Fix unsupported linker error messageAndrea Pappacoda
An `f` was dropped in bd6f46e723813dfadaba1f7c87d3b0b751d05219
2021-07-05condense linesEli Schwartz
2021-07-05simplify mesonlib imports for the sake of line lengthsEli Schwartz
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz
2021-07-01C2000: linker uses now binary setting defined within the cross-filemiebka
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger
2021-06-27Update detect.pyIan Harvey
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 Mensinger
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger
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 Handville
2021-06-22Fix for Issue 8910 (Meson filters CMake asm files)Justin Handville
2021-06-18holders: Introduce HoldableObjectDaniel Mensinger
2021-06-18interpreter: Refactor interpreter.compiler to use ObjectHolderDaniel Mensinger
2021-06-09compilers: Fix missing functions in Compiler base classDaniel Mensinger
2021-06-07upgrade percent formatted strings pyupgrade did not catchEli Schwartz
2021-06-07condense linesEli Schwartz
2021-06-07more f-strings everywhereEli Schwartz
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 Baker
2021-06-07compilers: Add cython file suffixesDylan Baker