summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
Commit message (Collapse)AuthorAgeFilesLines
* compilers: clang-cl: Also accept .s files (#8520)D Scott Phillips2021-03-241-0/+3
| | | | | | | * compilers: clang-cl: Also accept .s files clang-cl has support for gas-compatible assembly files. * Add clang-cl to '128 generated assembly' test
* Remove -pipe from default list of args. Closes #8508.Jussi Pakkanen2021-03-232-7/+1
|
* split program related classes and functions out of dependenciesDylan Baker2021-03-199-9/+14
| | | | | | Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
* Fix D lib search path translationRemi Thebault2021-03-171-15/+49
| | | | | | | This requires quite a complex and messy logic. As @dcbaker suggested in #8491, this could be replaced by an abstraction over linker flags instead of having GNU flags translated.
* ninjabackend: Use rsp_file_syntax methodDylan Baker2021-03-141-3/+4
| | | | | This also makes us of the new enum value in the backend, for better type saftey.
* compilers/linkers: Add a methhod for getting the rspfile syntaxDylan Baker2021-03-143-3/+27
|
* Add address sanitizer support for Visual Studio.Jussi Pakkanen2021-03-092-1/+9
|
* Add /Od flag to msvc optimization 0 argsVili Väinölä2021-03-081-1/+1
| | | | | Without specifying optimization the used optimization depends on vs runtime-library. With mdd it is /Od but with md it is /O2.
* compilers: Use EnvironmentException not EnvironmentError/OSErrorDylan Baker2021-03-041-8/+8
| | | | | The latter is a python built-in exception, the former is a meson exception.
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-0415-62/+62
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* various python neatness cleanupsEli Schwartz2021-03-044-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
* raw string literals are next to godlinessEli Schwartz2021-03-041-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.
* fix missing versions with generated sourceRemi Thebault2021-03-021-0/+6
|
* D add build dir to -J switchRemi Thebault2021-03-011-2/+6
|
* [CUDA] Bugfix: Forward sanitizer_*_args() methods to host compiler.Olexa Bilaniuk2021-02-221-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.
* Ensure that $lang_args and $lang_link_args are properly parsedDylan Baker2021-02-191-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
* compilers: clang: Drop -Xclang before -fcolor-diagnostics flagKrzysztof Małysa2021-02-181-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
* compilers: Only insert -flto-jobs in clang's link argumentsDylan Baker2021-02-173-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
* Add optional -Dcuda_ccbindir= option and -ccbin flag to CUDA compiler.Olexa Bilaniuk2021-02-161-8/+32
| | | | Closes #8110.
* Armour-grade quoting to account for NVCC's -Xcompiler peculiarities.Olexa Bilaniuk2021-02-161-14/+84
|
* Extensive rewrite of GCC/MVSC flag translation to NVCC flags.Olexa Bilaniuk2021-02-161-31/+313
|
* Add default debug flags for two configurations to NVCC.Olexa Bilaniuk2021-02-161-2/+2
|
* Add custom entyr to cuda buildtype dict. Closes #8336.Jussi Pakkanen2021-02-141-0/+1
|
* Add support for LLVM's thinLTODylan Baker2021-02-023-8/+21
| | | | | | | This uses a separate option, b_lto_mode. It works in conjunction with b_lto_threads. Fixes #7493
* compilers: Add support for using multiple threads with ltoDylan Baker2021-02-023-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
* split mesonlib into a packageDylan Baker2021-01-231-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.
* MSVC and Clang-Cl Compiler Argument CleanupMarios Staikopoulos2021-01-201-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
* Avoid accidental use of STANDALONE_WASM mode on compiler testsBrion Vibber2021-01-201-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.
* Removal of /ZI on MSVC DebugMarios Staikopoulos2021-01-171-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.
* Fix misspellsAntonin Décimo2021-01-133-6/+6
| | | | Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
* move handling of CFLAGS and friends to environmentDylan Baker2021-01-113-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.
* use PEP8 style naming for LANGUAGES_USING_* as wellDylan Baker2021-01-112-5/+5
|
* rename cflags_mapping to CFLAGS_MAPPINGDylan Baker2021-01-111-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.
* Use a single coredata dictionary for optionsDylan Baker2021-01-042-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).
* use OptionKey for builtin and base optionsDylan Baker2021-01-0414-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.
* move OptionKey to mesonlibDylan Baker2021-01-047-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
* use OptionKey for compiler_optionsDylan Baker2021-01-0412-202/+260
|
* Add choices to OptionProxyDylan Baker2021-01-043-23/+23
| | | | they're probably not strictly needed, but it makes mypy happy.
* Implement support of dlang -makedeps switch (#8119)Remi Thebault2020-12-291-2/+31
| | | | | | | * Implement support of dlang -makedeps switch Fix #8118 * resolve code review comments
* Propagate Windows target checks upLaurin-Luis Lehning2020-12-143-9/+7
|
* Give get_gui_app_args access to the EnvironmentLaurin-Luis Lehning2020-12-142-3/+3
|
* Slight consistency changes to get_gui_app_argsLaurin-Luis Lehning2020-12-142-9/+2
|
* Give get_win_subsystem_args access to envLaurin-Luis Lehning2020-12-141-2/+2
|
* Make win_subsystem a linker propertyLaurin-Luis Lehning2020-12-144-28/+4
|
* Merge pull request #8013 from mesonbuild/cppmodulesJussi Pakkanen2020-12-141-1/+1
|\ | | | | C++ module support
| * Create unit test for C++ modules and accept ixx as C++ source extension.Jussi Pakkanen2020-12-111-1/+1
| |
* | Add support for driving lld-link indirectly through clang on WindowsLaurin-Luis Lehning2020-12-131-1/+7
|/
* compilers: add support for c++20/gnu++20Florian Schmaus2020-12-101-4/+7
| | | | Fixes #8084.
* Add prelinking support for static libraries.Jussi Pakkanen2020-12-032-0/+5
|
* compilers/fortran: Add "none" to intel compielrs for standardsDylan Baker2020-11-241-2/+2
| | | | Fixes #8023