aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
AgeCommit message (Collapse)AuthorFilesLines
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-2/+2
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-09compilers: Fix missing functions in Compiler base classDaniel Mensinger1-0/+19
2021-06-07compilers: Add cython file suffixesDylan Baker1-0/+2
2021-06-02use an immutable list for an lru_cached functionsDylan Baker1-0/+1
When mutable items are stored in an lru cache, changing the returned items changes the cached items as well. Therefore we want to ensure that we're not mutating them. Using the ImmutableListProtocol allows mypy to find mutations and reject them. This doesn't solve the problem of mutable values inside the values, so you could have to do things like: ```python ImmutableListProtocol[ImmutableListProtocol[str]] ``` or equally hacky. It can also be used for input types and acts a bit like C's const: ```python def foo(arg: ImmutableListProtocol[str]) -> T.List[str]: arg[1] = 'foo' # works while running, but mypy errors ```
2021-05-19compilers: Add `get_debug_args` to base CompilerDylan Baker1-0/+4
This was missed, there should be an implementation in the base Compiler class, if for nothing else to help mypy
2021-05-19.C files are now treated as C++ codeVolker-Weissmann1-2/+4
2021-04-01environment: get environment variables for both host and build machinesDylan Baker1-8/+15
Fixes #8605
2021-03-30Split environment variable and command line cflagsDylan Baker1-4/+7
They are supposed to have different behavior. The environment variables apply to both the compiler and linker when the compiler acts as a linker, but the command line ones do not. Fixes #8345
2021-03-14compilers/linkers: Add a methhod for getting the rspfile syntaxDylan Baker1-1/+9
2021-03-04compilers: Use EnvironmentException not EnvironmentError/OSErrorDylan Baker1-8/+8
The latter is a python built-in exception, the former is a meson exception.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-16/+16
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz1-9/+9
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-02-19Ensure that $lang_args and $lang_link_args are properly parsedDylan Baker1-16/+12
Currently we don't handle things correctly if we get a string we should split, and the linker and needs compiler arguments. It would result in two unsplit strings in a list, instead of the split arguments in a list Fixes: #8348
2021-02-17compilers: Only insert -flto-jobs in clang's link argumentsDylan Baker1-2/+4
Clang has a hand `-Wunused-command-line-argument` switch, which when turned to an error, gets very grump about `-flto-jobs=0` being set in the compiler arguments (although `-flto=` belongs there). We'll refactor a bit to put that only in the link arguments. GCC doesn't have this probably because, a) it doesn't have an equivalent warning, and b) it uses `-flto=<$numthreads. Fixes: #8347
2021-02-16Add default debug flags for two configurations to NVCC.Olexa Bilaniuk1-2/+2
2021-02-14Add custom entyr to cuda buildtype dict. Closes #8336.Jussi Pakkanen1-0/+1
2021-02-02Add support for LLVM's thinLTODylan Baker1-2/+6
This uses a separate option, b_lto_mode. It works in conjunction with b_lto_threads. Fixes #7493
2021-02-02compilers: Add support for using multiple threads with ltoDylan Baker1-2/+18
Both Clang and GCC support using multiple threads for preforming link time optimizaions, and they can now be configured using the `-Db_lto_threads` option. Fixes #7820
2021-01-13Fix misspellsAntonin Décimo1-3/+3
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-11move handling of CFLAGS and friends to environmentDylan Baker1-60/+15
This has a bunch of nice features. It obviously centralizes everything, which is nice. It also means that env is only re-read at `meson --wipe`, not `meson --reconfigure`. And it's going to allow more cleanups.
2021-01-11use PEP8 style naming for LANGUAGES_USING_* as wellDylan Baker1-4/+4
2021-01-11rename cflags_mapping to CFLAGS_MAPPINGDylan Baker1-14/+18
This is PEP8 convention for a const variable. Also, make the type Mapping, which doesn't have mutation methods. This means mypy will warn us if someone tries to change this.
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-55/+51
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04move OptionKey to mesonlibDylan Baker1-2/+1
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker1-13/+13
2020-12-14Propagate Windows target checks upLaurin-Luis Lehning1-4/+4
2020-12-14Give get_gui_app_args access to the EnvironmentLaurin-Luis Lehning1-2/+2
2020-12-14Slight consistency changes to get_gui_app_argsLaurin-Luis Lehning1-1/+2
2020-12-14Give get_win_subsystem_args access to envLaurin-Luis Lehning1-2/+2
2020-12-14Make win_subsystem a linker propertyLaurin-Luis Lehning1-5/+4
2020-12-11Create unit test for C++ modules and accept ixx as C++ source extension.Jussi Pakkanen1-1/+1
2020-12-03Add prelinking support for static libraries.Jussi Pakkanen1-0/+2
2020-11-23Add a variant of TemporaryDirectory that uses windows_proof_rmtree()Christoph Reiter1-53/+48
Adds TemporaryDirectoryWinProof which calls windows_proof_rmtree() on error. Use instead of hacky error handling (which might shadow other OSError) in Compiler.compile().
2020-11-17Revert "Add thinlto support. Closes #7493."Jussi Pakkanen1-8/+8
This reverts commit 3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.
2020-11-08Fix "generator doesn't stop" on WindowsChristoph Reiter1-1/+1
When TemporaryDirectory() cleans up on __exit__ it sometimes throws OSError noting that the dir isn't empty. This happens after the first yield in this generator and leads to the exception being handled which leads to a second yield. contextlib.contextmanager() fails then since the function it wraps is only allowed to yield once. Fix this by not yielding again in the error case. Fixes #7947
2020-11-08Add thinlto support. Closes #7493.Jussi Pakkanen1-8/+8
2020-10-16Refactor handling of machine file optionsXavier Claessens1-8/+3
It is much easier to not try to parse options into complicated structures until we actually collected all options: machine files, command line, project()'s default_options, environment.
2020-10-14vs: add static_from_buildtype to b_vscrtPeter Harris1-1/+1
2020-10-07Add win_subsystem kwarg. Closes #7765.Jussi Pakkanen1-0/+7
2020-10-01compilers: make get_optimization_args abstractDylan Baker1-1/+2
2020-10-01compilers/d: add type annotationsDylan Baker1-0/+5
2020-10-01compilers: move _build_wrapper out of clike into CompilerDylan Baker1-14/+74
This abstraction is really useful, and most compilers could use it (including D). It also will allow the Gnu mixins to work properly without the CLikeCompiler in their mro.
2020-10-01compilers: move get_compile_check_args() to CompilerDylan Baker1-4/+30
This is groundwork to put _build_wrapper in the base Compiler, which is needed to make the D compilers truly type safe.
2020-10-01compilers/fortran: add type annotationsDylan Baker1-0/+9
2020-10-01Compilers/vala: Add type annotationsDylan Baker1-0/+9
2020-10-01compilers/cuda: make type safeDylan Baker1-0/+10
2020-10-01compilres: move depfile_for_object to compilerDylan Baker1-0/+5