aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)AuthorFilesLines
2021-03-08Add /Od flag to msvc optimization 0 argsVili Väinölä1-1/+1
Without specifying optimization the used optimization depends on vs runtime-library. With mdd it is /Od but with md it is /O2.
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 Schwartz15-62/+62
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz4-26/+26
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-03-04raw string literals are next to godlinessEli Schwartz1-2/+2
Invalid escape sequences are deprecated and will be removed from a future version of python. Use r"" to define them so they remain readable.
2021-03-02fix missing versions with generated sourceRemi Thebault1-0/+6
2021-03-01D add build dir to -J switchRemi Thebault1-2/+6
2021-02-22[CUDA] Bugfix: Forward sanitizer_*_args() methods to host compiler.Olexa Bilaniuk1-0/+6
Enables -Db_sanitize=undefined and company. Also serves as a testcase for NVCC comma-shielding: Because the test- case declares `b_sanitize=address,undefined`, the host GCC compiler needs `-fsanitize=address,undefined`, but this stands a danger of being split by NVCC when wrapped with `-Xcompiler=args,args`. Special, already-existing comma-shielding codepaths activate to prevent this splitting. Closes #8394.
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-18compilers: clang: Drop -Xclang before -fcolor-diagnostics flagKrzysztof Małysa1-3/+3
Using -Xclang -fcolor-diagnostics provides no advantage to using just -fcolor-diagnostics option and sometimes causes problems: * uncolored diagnostics on Arch Linux: https://bugs.archlinux.org/task/69662 * simple problem with removing flag -fcolor-diagnostics: https://github.com/clangd/clangd/issues/279
2021-02-17compilers: Only insert -flto-jobs in clang's link argumentsDylan Baker3-3/+9
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 optional -Dcuda_ccbindir= option and -ccbin flag to CUDA compiler.Olexa Bilaniuk1-8/+32
Closes #8110.
2021-02-16Armour-grade quoting to account for NVCC's -Xcompiler peculiarities.Olexa Bilaniuk1-14/+84
2021-02-16Extensive rewrite of GCC/MVSC flag translation to NVCC flags.Olexa Bilaniuk1-31/+313
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 Baker3-8/+21
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 Baker3-5/+42
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-23split mesonlib into a packageDylan Baker1-1/+2
Currently mesonlib does some import tricks to figure out whether it needs to use windows or posix specific functions. This is a little hacky, but works fine. However, the way the typing stubs are implemented for the msvcrt and fnctl modules will cause mypy to fail on the other platform, since the functions are not implemented. To aleviate this (and for slightly cleaner design), I've split mesonlib into a pacakge with three modules. A universal module contains all of the platform agnositc code, a win32 module contains window specific code, a posix module contains the posix specific code, and a platform module contains no-op implementations. Then the package's __init__ file imports all of the universal functions and all of the functions from the approriate platform module, or the no-op versions as fallbacks. This makes mypy happy, and avoids `if`ing all over the code to switch between the platform specific code.
2021-01-20MSVC and Clang-Cl Compiler Argument CleanupMarios Staikopoulos1-27/+6
This commit performs some cleanup for the msvc and clang-cl arguments. * "Disable Debug" (`/Od`) is no longer manually specified for optimization levels {`0`,`g`} (it is already the default for MSVC). * "Run Time Checking" (`/RTC1`) removed from `debug` buildtype by default * Clang-CL `debug` buildtype arguments now match MSVC arguments * There is now no difference between `buildtype` flags and `debug` + `optimization` flags
2021-01-20Avoid accidental use of STANDALONE_WASM mode on compiler testsBrion Vibber1-1/+1
Compiler tests, such as checking for atomics support, could fail when compiling to WebAssembly multithreaded targets because the compiler tests got compiled to 'output.wasm'. Using the '.wasm' suffix in recent versions of emscripten engages STANDALONE_WASM mode, which disables features that require a JS runtime like shared memory. This created false negatives on support of those features when building a library to be linked into an executable that is not in STANDALONE_WASM mode. Changing these to 'output.o' will continue to produce WebAssembly object files, but they will no longer be configured for standalone runtime mode.
2021-01-17Removal of /ZI on MSVC DebugMarios Staikopoulos1-2/+2
The /ZI flag adds in "Edit and Continue" debug information, which will cause massive slowdown. It is not a flag that we should be adding by default to debug builds. /Zi will still be added.
2021-01-13Fix misspellsAntonin Décimo3-6/+6
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-11move handling of CFLAGS and friends to environmentDylan Baker3-64/+17
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 Baker2-5/+5
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 a single coredata dictionary for optionsDylan Baker2-3/+3
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker14-87/+94
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 Baker7-15/+16
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 Baker12-202/+260
2021-01-04Add choices to OptionProxyDylan Baker3-23/+23
they're probably not strictly needed, but it makes mypy happy.
2020-12-29Implement support of dlang -makedeps switch (#8119)Remi Thebault1-2/+31
* Implement support of dlang -makedeps switch Fix #8118 * resolve code review comments
2020-12-14Propagate Windows target checks upLaurin-Luis Lehning3-9/+7
2020-12-14Give get_gui_app_args access to the EnvironmentLaurin-Luis Lehning2-3/+3
2020-12-14Slight consistency changes to get_gui_app_argsLaurin-Luis Lehning2-9/+2
2020-12-14Give get_win_subsystem_args access to envLaurin-Luis Lehning1-2/+2
2020-12-14Make win_subsystem a linker propertyLaurin-Luis Lehning4-28/+4
2020-12-14Merge pull request #8013 from mesonbuild/cppmodulesJussi Pakkanen1-1/+1
C++ module support
2020-12-13Add support for driving lld-link indirectly through clang on WindowsLaurin-Luis Lehning1-1/+7
2020-12-11Create unit test for C++ modules and accept ixx as C++ source extension.Jussi Pakkanen1-1/+1
2020-12-10compilers: add support for c++20/gnu++20Florian Schmaus1-4/+7
Fixes #8084.
2020-12-03Add prelinking support for static libraries.Jussi Pakkanen2-0/+5
2020-11-24compilers/fortran: Add "none" to intel compielrs for standardsDylan Baker1-2/+2
Fixes #8023
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-20use real pathlib moduleDylan Baker3-3/+3
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
2020-11-17Revert "Add thinlto support. Closes #7493."Jussi Pakkanen4-20/+11
This reverts commit 3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.
2020-11-14Merge pull request #7843 from dcbaker/submit/rustc-fixesJussi Pakkanen1-0/+4
A few fixups for rust
2020-11-13msvc: enable /std:c17 flagjpark371-8/+19
Increase allowed c_std options, and check compiler version. Also update mlog pattern to not crash.
2020-11-13compilers/rust: add and use an implementation of use_linker_argsDylan Baker1-0/+4
2020-11-13Merge pull request #7866 from dcbaker/submit/compiler-std-in-baseJussi Pakkanen4-170/+123
Put the Compiler standard option in the Language mixin