summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
AgeCommit message (Collapse)Author
2020-02-27compilers/mixins/emscripten: Implement thread supportDylan Baker
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
2020-02-27compilers/emcc: Fix inheritance orderDylan Baker
Sot hat the BasicLinkerIsCompilerMixin comes before ClangCCompiler, which hides its "call the linker" methods, as emcc doesn't have a separate linker.
2020-01-30-Fixed Renesas RX Family compiler to work with latest meson, updated ↵alanNz
cross-file, fixed assembly file use
2020-01-28compilers: Split ClangCL and MSVC mixinsDylan Baker
Instead of checking the compiler id inside the VisualStudioLikeCompiler class, this creates two subclasses that each represent the divergent behavior of the two compilers
2020-01-27Bringing back defines in Elbrus C compiler to simplify environment.pymakise-homura
2020-01-27Fix missing 'defines' argumet for Elbrus compilermakise-homura
...But somehow it still remains in C++ compiler.
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger
2020-01-06Updated linker MR (#6407)Jussi Pakkanen
* 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.
2019-12-17Merge pull request #6065 from dcbaker/pass-options-to-linker-detectionJussi Pakkanen
Pass options to linker detection
2019-12-13compilers: make use of mlog.log_onceDylan Baker
I'm sure there are other places that could use this, but I didn't see any right off that bat.
2019-12-12compilers: move language attribute to the class levelDylan Baker
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.
2019-11-18Use strict function prototypesMichael Hirsch, Ph.D
2019-10-18Refactor duplicate Emscripten code into a mixinAndrei Alexeyev
2019-10-15Fix emscripten C compiler initializationAndrei Alexeyev
2019-10-14Implement get_linker_output_args in Emscripten compilersAndrei Alexeyev
2019-10-14Implement get_allow_undefined_link_args in EmscriptenCCompilerAndrei Alexeyev
2019-10-11compilers: Fix version requirements for ClangC and AppleClangCTing-Wei Lan
Commit ff4a17dbef08a1d8afd075f57dbab0f5c76951ab modified the version requirements wrongly. AppleClangC should be the one with higher version numbers. Exchange them to fix the check.
2019-10-07compilers: replace CompilerType with MachineInfoDylan Baker
Now that the linkers are split out of the compilers this enum is only used to know what platform we're compiling for. Which is what the MachineInfo class is for
2019-10-07compilers: Add a specific type for AppleClangCDylan Baker
This allows us to detect use classes rather than methods to determine what C standards are available.
2019-08-14compilers: Dispatch to dynamic linker classDylan Baker
Most of the cuda code is from Olexa Bilaniuk. Most of the PGI code is from Michael Hirsc
2019-08-14compilers: Make MSVClike compilers proxy extra keyword argumentsDylan Baker
2019-08-05Add basic Webassembly support via Emscripten.Jussi Pakkanen
2019-07-16Fix missing return statements that are seen with -Werror=return-type.Martin Liska
Error example: Code: #include <locale.h> int main () { /* If it's not defined as a macro, try to use as a symbol */ #ifndef LC_MESSAGES LC_MESSAGES; #endif } Compiler stdout: Compiler stderr: In file included from /usr/include/locale.h:25, from /tmp/tmpep_i4iwg/testfile.c:2: /usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] 382 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | ^~~~~~~ /tmp/tmpep_i4iwg/testfile.c: In function 'main': /tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type] 8 | } | ^ cc1: some warnings being treated as errors
2019-07-15compilers: split pgi compiler out of compilers moduleDylan Baker
2019-07-15compilers: put elbrus in mixinsDylan Baker
2019-07-15compilers: Put clang mixin in a moduleDylan Baker
2019-07-15compilers: move ArmClang into mixins/arm.pyDylan Baker
2019-07-15compilers: Put Intel compiler classes into the mixins folderDylan Baker
2019-07-15compilers: split gnu and gnulike compilers out of compilersDylan Baker
I debated a bit whether both classes really belong in the same module, and decided that they do because the share a number of helpers.
2019-07-15compilers: Move the VisualStudioLikeCompiler class into mixinsDylan Baker
2019-07-15compilers: Move ArmCompiler to a mixin moduleDylan Baker
2019-07-15compilers: move ccrx compiler abstraction into mixinsDylan Baker
2019-07-15compilers: Move clike into a mixins directoryDylan Baker
The compilers module is rather large and confusing, with spaghetti dependencies going every which way. I'm planning to start breaking out the internal representations into a mixins submodule, for things that shouldn't be required outside of the compilers module itself.
2019-07-14Do not fail on passing `-Werror=unused-parameter` from environmentDavid Seifert
2019-07-08add clang c_std=c18 aliasMichael Hirsch, Ph.D
fix unit test skips for clang c18 correct unittests clang minimum version cleanup unittest clang skip c_std finesse unittest vs. clang version
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-06-06compilers/c: Fix removal of name from Combo options for ICLDylan Baker
2019-05-15UserOption no longer has a name field.John Ericson
This avoids the duplication where the option is stored in a dict at its name, and also contains its own name. In general, the maxim in programming is things shouldn't know their own name, so removed the name field just leaving the option's position in the dictionary as its name.
2019-05-13compilers: Add basic ICL abstractionsDylan Baker
2019-05-13compilers: rename IntelCompiler to IntelGnuLikeCompilerDylan Baker
The Intel compiler is strange. On Linux and macOS it's called ICC, and it tries to mostly behave like gcc/clang. On Windows it's called ICL, and tries to behave like MSVC. This makes the code that's used to implement ICC support useless for supporting ICL, because their command line interfaces are completely different.
2019-05-03compilers: Split C-Like functionality into a mixin classesDylan Baker
Currently C++ inherits C, which can lead to diamond problems. By pulling the code out into a standalone mixin class that the C, C++, ObjC, and Objc++ compilers can inherit and override as necessary we remove one source of diamonding. I've chosen to split this out into it's own file as the CLikeCompiler class is over 1000 lines by itself. This also breaks the VisualStudio derived classes inheriting from each other, to avoid the same C -> CPP inheritance problems. This is all one giant patch because there just isn't a clean way to separate this. I've done the same for Fortran since it effectively inherits the CCompiler (I say effectively because was it actually did was gross beyond explanation), it's probably not correct, but it seems to work for now. There really is a lot of layering violation going on in the Compilers, and a really good scrubbing would do this code a lot of good.
2019-05-02Revert "detect Intel ICL on windows"Dylan Baker
This reverts commit 3a75bb5259abbcae820b47f5f4633c564411893b.
2019-05-02Merge pull request #4952 from mensinda/cacheCompilesDylan Baker
Cache compilers.compile() in coredata
2019-04-29Fix blind exceptionsDaniel Mensinger
2019-04-28Moved caching into a seperate functionDaniel Mensinger
2019-04-28Disable cache for dependenciesDaniel Mensinger
2019-04-28Add option to disable the cacheDaniel Mensinger
2019-04-28Changing cached flag from True to FalseDaniel Mensinger
2019-04-28Added some cahced valuesDaniel Mensinger
2019-04-28Print '(cached)' when compiler result was cachedDaniel Mensinger