aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
AgeCommit message (Collapse)AuthorFilesLines
2019-08-14compilers: Dispatch to dynamic linker classDylan Baker1-22/+2
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 Baker1-6/+6
2019-08-05Add basic Webassembly support via Emscripten.Jussi Pakkanen1-0/+25
2019-07-16Fix missing return statements that are seen with -Werror=return-type.Martin Liska1-0/+1
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 Baker1-1/+1
2019-07-15compilers: put elbrus in mixinsDylan Baker1-1/+1
2019-07-15compilers: Put clang mixin in a moduleDylan Baker1-1/+1
2019-07-15compilers: move ArmClang into mixins/arm.pyDylan Baker1-2/+1
2019-07-15compilers: Put Intel compiler classes into the mixins folderDylan Baker1-2/+1
2019-07-15compilers: split gnu and gnulike compilers out of compilersDylan Baker1-1/+1
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 Baker1-1/+1
2019-07-15compilers: Move ArmCompiler to a mixin moduleDylan Baker1-1/+1
2019-07-15compilers: move ccrx compiler abstraction into mixinsDylan Baker1-2/+1
2019-07-15compilers: Move clike into a mixins directoryDylan Baker1-1/+1
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 Seifert1-1/+1
2019-07-08add clang c_std=c18 aliasMichael Hirsch, Ph.D1-4/+7
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 Ericson1-25/+25
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 Baker1-1/+1
2019-05-15UserOption no longer has a name field.John Ericson1-10/+9
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 Baker1-1/+32
2019-05-13compilers: rename IntelCompiler to IntelGnuLikeCompilerDylan Baker1-3/+3
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 Baker1-1471/+21
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 Baker1-6/+0
This reverts commit 3a75bb5259abbcae820b47f5f4633c564411893b.
2019-05-02Merge pull request #4952 from mensinda/cacheCompilesDylan Baker1-28/+35
Cache compilers.compile() in coredata
2019-04-29Fix blind exceptionsDaniel Mensinger1-1/+1
2019-04-28Moved caching into a seperate functionDaniel Mensinger1-2/+7
2019-04-28Disable cache for dependenciesDaniel Mensinger1-4/+4
2019-04-28Add option to disable the cacheDaniel Mensinger1-8/+8
2019-04-28Changing cached flag from True to FalseDaniel Mensinger1-1/+1
2019-04-28Added some cahced valuesDaniel Mensinger1-3/+4
2019-04-28Print '(cached)' when compiler result was cachedDaniel Mensinger1-15/+16
2019-04-28Cache compile results in coredataDaniel Mensinger1-2/+2
2019-04-27detect Intel ICL on windowsMichael Hirsch, Ph.D1-0/+6
ICL CPP working
2019-04-27better default order for fotran compiler searchMichael Hirsch, Ph.D1-2/+2
correct PGI windows detection doc cleanup PGI detect
2019-04-25Don't use len() to test for container emptinessDylan Baker1-1/+1
I ran the numbers once before (it's in the meson history) but it's *much* faster to *not* use len for testing if a container is empty or not.
2019-04-18vs: Update toolset table for VS 2019Nirbheek Chauhan1-0/+3
Also add a test to ensure that we don't forget it in the future.
2019-04-10Update Built-in Option c_std for C17. Closes #4842.jrl641-4/+17
2019-04-05dependencies/misc: don't special case threadsDylan Baker1-4/+0
Instad of having special casing of threads in the backends and everywehre else, do what we did for openmp, create a real dependency. Then make use of the fact that dependencies can now have sub dependencies to add threads.
2019-03-27Sanity check with external argsJohn Ericson1-21/+30
Previously cross, but not native, external args were used. Then in d451a4bd97f827bb492fd0c0e357cb20b6056ed9 the cross special cases were removed, so external args are never used. This commit switches that so they are always used. Sanity checking works just the same as compiler checks like has header / has library.
2019-03-27Don't collect preprocssor flags separately from compiler flagsJohn Ericson1-5/+2
I recall that @jpakkane never wanted this, but @nirbheek did, but then @nirbheek changed his mind. I am fine either way except for the cross inconsistency that exists today: There is no `c_preproc_args` or similar one can put in the cross file, so no way to replicate the effect of CPPFLAGS during cross compilation.
2019-03-21Merge pull request #5116 from dcbaker/openmp-de-specializeJussi Pakkanen1-2/+0
dependencies/openmp: Don't special case OpenMP
2019-03-20replace library type strings with an enumDylan Baker1-13/+12
This patch creates an enum for selecting libtype as static, shared, prefer-static, or prefer-shared. This also renames 'static-shared' with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is just a refactor with no behavioral changes or user facing changes.
2019-03-19dependencies/openmp: Don't special case OpenMPDylan Baker1-2/+0
Currently we specialcase OpenMP like we do threads, with a special `need_openmp` method. This seems like a great idea, but doesn't work out in practice, as well as it complicates the opemp implementation. If GCC is built without opemp support for example, we still add -fopenmp to the the command line, which results in compilation errors. This patch discards that and treats it like a normal dependency, removes the need_openmp() method, and sets the compile_args attributes from the compiler. Fixes #5115
2019-03-19Merge pull request #4724 from jon-turney/lib-machine-alwaysJussi Pakkanen1-1/+8
Fix linking when cross-compiling and a windows resource is first object
2019-03-14compilers: Update comment about library search patternsNirbheek Chauhan1-2/+4
2019-03-14compilers: Try harder to dedup builtin libsNirbheek Chauhan1-4/+3
Compiler internal libs should always be de-duplicated, no matter what. Closes https://github.com/mesonbuild/meson/issues/2150 Test case is by Bruce Richardson in the issue.
2019-03-11Add static as keyword to find_libraryNiklas Claesson1-16/+19
2019-03-11Fix _get_patterns on OpenBSDAntoine Jacoutot1-1/+2
We need to account to the possible prefixes (empty or 'lib'). This allows both to work: cc.find_library('foo') cc.find_library('libfoo')
2019-02-19Add warning level zerojml17951-6/+11
2019-02-15Remove get_cross_extra_flagsJohn Ericson1-27/+20
This is no longer needed, we just remove conditionals around it.