summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
Commit message (Collapse)AuthorAgeFilesLines
* Support ancient (<3.4.0) gcc versionsWilliam Toohey2021-11-161-1/+4
|
* fix various flake8 whitespace errorsEli Schwartz2021-10-271-3/+3
|
* fix extra whitespaceEli Schwartz2021-10-041-1/+0
| | | | discovered via flake8 --select E303
* compilers/elbrus: Deal with C/C++/Fortran stds more correctlymakise-homura2021-09-291-6/+12
|
* compilers/elbrus: Fix incorrect inheritance model of Elbrus*Compilermakise-homura2021-09-291-5/+3
|
* compilers: Fix extra_args parameterDylan Baker2021-08-161-1/+2
| | | | | which can also be a callable taking a CompileChekcMode as an argumetn and returning a list of strings.
* upgrade percent formatted strings pyupgrade did not catchEli Schwartz2021-06-071-3/+3
|
* split program related classes and functions out of dependenciesDylan Baker2021-03-191-1/+2
| | | | | | 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.
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-041-3/+3
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* 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.
* Fix misspellsAntonin Décimo2021-01-131-1/+1
| | | | Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
* move handling of CFLAGS and friends to environmentDylan Baker2021-01-111-2/+1
| | | | | | 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.
* move OptionKey to mesonlibDylan Baker2021-01-041-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
* use OptionKey for compiler_optionsDylan Baker2021-01-041-62/+79
|
* Add choices to OptionProxyDylan Baker2021-01-041-12/+12
| | | | they're probably not strictly needed, but it makes mypy happy.
* msvc: enable /std:c17 flagjpark372020-11-131-8/+19
| | | | | | Increase allowed c_std options, and check compiler version. Also update mlog pattern to not crash.
* clang-cl: Allow clang-cl (when compiling C) to pass std to underlying clang)Dylan Baker2020-11-121-34/+33
| | | | | This allows a wider array of standard support than would be available directly from clang-cl, emulating MSVC stds.
* compilers/c: Log that MSVC doesn't support gnu stdsDylan Baker2020-11-121-1/+13
| | | | | | | | | Since the current approach of demoting to the nearest C standard *might* work, but might not. For projects like Glib that detect which standard is used and fall back this is fine. For projects like libdrm that only work with gnu standards, this wont. We're nog tusing a warning because this shouldn't be fatal if --meson-fatal-warnings is used. Also demote a similar message in IntelCl from warning to log.
* compilers: define standards in the base language compilerDylan Baker2020-11-121-84/+28
| | | | | | And then update the choices in each leaf class. This way we don't end up with another case where we implicitly allow an invalid standard to be set on a compiler that doesn't have a 'std' setting currently.
* compilers: Standardize the names of compiler optionsDylan Baker2020-11-121-9/+9
| | | | | | Most options don't use language prefaced options (std vs c_std) internally, as we don't need that due to namespacing. Let's do that across the board
* compilers/c: Clang-cl also needs specific handling for standardsDylan Baker2020-11-121-0/+19
|
* Make MSVC accept gnu11 as a language standard version. Closes: #7611.Jussi Pakkanen2020-11-121-3/+7
| | | | Fixes: #7611
* compilers: fully type annotate the C compilersDylan Baker2020-10-011-120/+196
|
* compilers: make is_cross part of the base Compiler classDylan Baker2020-09-241-2/+2
| | | | | | | Every class needs to set this, so it should be part of the base. For classes that require is_cross, the positional argument remains in their signature. For those that don't, they just allow the base class to set their value to it's default of False.
* compilers: make sanity_check_impl a protected methodDylan Baker2020-09-241-1/+1
| | | | It's an implementation detail after all
* Add support for the CompCert C CompilerSebastian Meyer2020-09-151-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add preliminary support for the CompCert C Compiler The intention is to use this with the picolibc, so some GCC flags are automatically filtered. Since CompCert uses GCC is for linking, those GCC-linker flags which are used by picolibc, are automatically prefixed with '-WUl', so that they're passed to GCC. Squashed commit of the following: commit 4e0ad66dca9de301d2e41e74aea4142afbd1da7d Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 14:20:39 2020 +0200 remove '-fall' from default arguments, also filter -ftls-model=.* commit 41afa3ccc62ae72824eb319cb8b34b7e6693cb67 Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 14:13:55 2020 +0200 use regex for filtering ccomp args commit d68d242d0ad22f8bf53923ce849da9b86b696a75 Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 13:54:36 2020 +0200 filter some gcc arguments commit 982a01756266bddbbd211c54e8dbfa2f43dec38f Author: Sebastian Meyer <meyer@absint.com> Date: Fri Aug 28 15:03:14 2020 +0200 fix ccomp meson configuration commit dce0bea00b1caa094b1ed0c6c77cf6c12f0f58d9 Author: Sebastian Meyer <meyer@absint.com> Date: Thu Aug 27 13:02:19 2020 +0200 add CompCert to meson (does not fully work, yet) * remove unused import and s/cls/self/ fixes the two obvious LGTM warnings * CompCert: Do not ignore unsupported GCC flags Some are safe to ignore, however, as per https://github.com/mesonbuild/meson/pull/7674, they should not be ignored by meson itself. Instead the meson.build should take care to select only those which are actually supported by the compiler. * remove unused variable * Only add arguments once. * Apply suggestions from code review Co-authored-by: Dylan Baker <dylan@pnwbakers.com> * Remove erroneous ' ' from '-o {}'.format() As noticed by @dcbaker * added release note snippet for compcert * properly split parameters As suggested by @dcbaker, these parameters should be properly split into multiple strings. Co-authored-by: Dylan Baker <dylan@pnwbakers.com> * Update add_compcert_compiler.md Added a sentence about the state of the implementation (experimental); use proper markdown * properly separate arguments Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
* Merge pull request #7600 from alexrp/masterJussi Pakkanen2020-08-231-2/+13
|\ | | | | Add C2x option support.
| * Add C2x option support.Alex Rønne Petersen2020-08-221-2/+13
| |
* | Merge pull request #7447 from scivision/nvcJussi Pakkanen2020-08-221-0/+9
|\ \ | |/ |/| Add support for NVidia HPC SDK compilers
| * add Nvidia HPC SDK compilersMichael Hirsch, Ph.D2020-07-131-0/+9
| |
* | msvc: enable /std:c11 flagMichael Hirsch2020-08-091-0/+20
|/
* compilers: add fetching of define list for clangYevhenii Kolesnikov2020-05-221-2/+3
| | | | | | | | | | | | | | | Simmilar to gcc, the list of pre-processor defines can be fetched with `-dM -E` option. The way cpu_family is determined on linux relies on this list. Fixes incorrect value of cpu_family on linux, when crosscompiling: ``` CC="clang -m32" meson ./build ``` Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com> Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
* Compiler options per langJohn Ericson2020-04-201-43/+86
| | | | | | | | | | | A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
* Fix legacy env var support with crossJohn Ericson2020-03-231-1/+1
| | | | Fix #3969
* -Add xc16 and c2000 C,Cpp toolchain supportalanNz2020-03-211-0/+91
|
* Merge pull request #6688 from dcbaker/emcc-linker-bugsJussi Pakkanen2020-03-081-2/+2
|\ | | | | Emcc linker bugs and improvments
| * compilers/linkers: Add a representation for wasm-ldDylan Baker2020-02-271-2/+2
| | | | | | | | | | | | | | Emscripten does have a stand alone linker, wasm-ld. This patch adds the linker, adds detection for the linker, and removes the IsLinkerMixin for emscripten. This is a little more correct, and makes the code a lot cleaner and more robust.
| * compilers/mixins/emscripten: Implement thread supportDylan Baker2020-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | Emscripten has pthread support (as well as C++ threads), but we don't currently implement them. This fixes that by adding the necessary code. The one thing I'm not sure about is setting the pool size. The docs suggest that you really want to do this to ensure that your code works correctly, but the number should really be configurable, not sure how to set that. Fixes #6684
| * compilers/emcc: Fix inheritance orderDylan Baker2020-02-271-1/+1
| | | | | | | | | | | | Sot hat the BasicLinkerIsCompilerMixin comes before ClangCCompiler, which hides its "call the linker" methods, as emcc doesn't have a separate linker.
* | Set c_winlibs/cpp_winlibs for Clang in the same way as for GCCMartin Storsjö2020-03-031-0/+6
|/ | | | | clang-cl is handled as a separate case (ClangClCCompiler), which already gets c_winlibs from VisualStudioLikeCCompilerMixin.
* -Fixed Renesas RX Family compiler to work with latest meson, updated ↵alanNz2020-01-301-0/+3
| | | | cross-file, fixed assembly file use
* compilers: Split ClangCL and MSVC mixinsDylan Baker2020-01-281-7/+5
| | | | | | Instead of checking the compiler id inside the VisualStudioLikeCompiler class, this creates two subclasses that each represent the divergent behavior of the two compilers
* Bringing back defines in Elbrus C compiler to simplify environment.pymakise-homura2020-01-271-2/+3
|
* Fix missing 'defines' argumet for Elbrus compilermakise-homura2020-01-271-3/+3
| | | | ...But somehow it still remains in C++ compiler.
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-3/+3
|
* Updated linker MR (#6407)Jussi Pakkanen2020-01-061-1/+1
| | | | | | | | | | | | | | | | | | | * environment: Fix passing always args to a number of less common linkers These are mostly (oops xilink) proprietary linkers I can't use for various reasons. Fixes: #6332 * Add intelfix from scivision. * Ifort fix from scivision. * PGI fix from scivision. * Cuda fix from scivision. * Fix linker passing for armclang.
* Merge pull request #6065 from dcbaker/pass-options-to-linker-detectionJussi Pakkanen2019-12-171-1/+2
|\ | | | | Pass options to linker detection
| * compilers: move language attribute to the class levelDylan Baker2019-12-121-1/+2
| | | | | | | | | | We know that if a compiler class inherits CCompiler it's language will be C, so doing this at the class level makes more sense.
* | compilers: make use of mlog.log_onceDylan Baker2019-12-131-5/+1
|/ | | | | I'm sure there are other places that could use this, but I didn't see any right off that bat.
* Use strict function prototypesMichael Hirsch, Ph.D2019-11-181-2/+2
|