summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
Commit message (Collapse)AuthorAgeFilesLines
...
* compilers: Dispatch to dynamic linker classDylan Baker2019-08-141-22/+2
| | | | | Most of the cuda code is from Olexa Bilaniuk. Most of the PGI code is from Michael Hirsc
* compilers: Make MSVClike compilers proxy extra keyword argumentsDylan Baker2019-08-141-6/+6
|
* Add basic Webassembly support via Emscripten.Jussi Pakkanen2019-08-051-0/+25
|
* Fix missing return statements that are seen with -Werror=return-type.Martin Liska2019-07-161-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
* compilers: split pgi compiler out of compilers moduleDylan Baker2019-07-151-1/+1
|
* compilers: put elbrus in mixinsDylan Baker2019-07-151-1/+1
|
* compilers: Put clang mixin in a moduleDylan Baker2019-07-151-1/+1
|
* compilers: move ArmClang into mixins/arm.pyDylan Baker2019-07-151-2/+1
|
* compilers: Put Intel compiler classes into the mixins folderDylan Baker2019-07-151-2/+1
|
* compilers: split gnu and gnulike compilers out of compilersDylan Baker2019-07-151-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.
* compilers: Move the VisualStudioLikeCompiler class into mixinsDylan Baker2019-07-151-1/+1
|
* compilers: Move ArmCompiler to a mixin moduleDylan Baker2019-07-151-1/+1
|
* compilers: move ccrx compiler abstraction into mixinsDylan Baker2019-07-151-2/+1
|
* compilers: Move clike into a mixins directoryDylan Baker2019-07-151-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.
* Do not fail on passing `-Werror=unused-parameter` from environmentDavid Seifert2019-07-141-1/+1
|
* add clang c_std=c18 aliasMichael Hirsch, Ph.D2019-07-081-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
* Purge `is_cross` and friends without changing user interfacesJohn Ericson2019-06-091-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.
* compilers/c: Fix removal of name from Combo options for ICLDylan Baker2019-06-061-1/+1
|
* UserOption no longer has a name field.John Ericson2019-05-151-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.
* compilers: Add basic ICL abstractionsDylan Baker2019-05-131-1/+32
|
* compilers: rename IntelCompiler to IntelGnuLikeCompilerDylan Baker2019-05-131-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.
* compilers: Split C-Like functionality into a mixin classesDylan Baker2019-05-031-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.
* Revert "detect Intel ICL on windows"Dylan Baker2019-05-021-6/+0
| | | | This reverts commit 3a75bb5259abbcae820b47f5f4633c564411893b.
* Merge pull request #4952 from mensinda/cacheCompilesDylan Baker2019-05-021-28/+35
|\ | | | | Cache compilers.compile() in coredata
| * Moved caching into a seperate functionDaniel Mensinger2019-04-281-2/+7
| |
| * Disable cache for dependenciesDaniel Mensinger2019-04-281-4/+4
| |
| * Add option to disable the cacheDaniel Mensinger2019-04-281-8/+8
| |
| * Changing cached flag from True to FalseDaniel Mensinger2019-04-281-1/+1
| |
| * Added some cahced valuesDaniel Mensinger2019-04-281-3/+4
| |
| * Print '(cached)' when compiler result was cachedDaniel Mensinger2019-04-281-15/+16
| |
| * Cache compile results in coredataDaniel Mensinger2019-04-281-2/+2
| |
* | Fix blind exceptionsDaniel Mensinger2019-04-291-1/+1
| |
* | detect Intel ICL on windowsMichael Hirsch, Ph.D2019-04-271-0/+6
| | | | | | | | ICL CPP working
* | better default order for fotran compiler searchMichael Hirsch, Ph.D2019-04-271-2/+2
|/ | | | | | | | correct PGI windows detection doc cleanup PGI detect
* Don't use len() to test for container emptinessDylan Baker2019-04-251-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.
* vs: Update toolset table for VS 2019Nirbheek Chauhan2019-04-181-0/+3
| | | | Also add a test to ensure that we don't forget it in the future.
* Update Built-in Option c_std for C17. Closes #4842.jrl642019-04-101-4/+17
|
* dependencies/misc: don't special case threadsDylan Baker2019-04-051-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.
* Sanity check with external argsJohn Ericson2019-03-271-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.
* Don't collect preprocssor flags separately from compiler flagsJohn Ericson2019-03-271-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.
* Merge pull request #5116 from dcbaker/openmp-de-specializeJussi Pakkanen2019-03-211-2/+0
|\ | | | | dependencies/openmp: Don't special case OpenMP
| * dependencies/openmp: Don't special case OpenMPDylan Baker2019-03-191-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
* | replace library type strings with an enumDylan Baker2019-03-201-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.
* | Merge pull request #4724 from jon-turney/lib-machine-alwaysJussi Pakkanen2019-03-191-1/+8
|\ \ | |/ |/| Fix linking when cross-compiling and a windows resource is first object
| * Fix linking when cross-compiling and a windows resource is first objectJon Turney2019-01-051-1/+8
| | | | | | | | | | | | | | | | It appears that LIB/LINK default to the host architecture if they can't guess it from the first object. With the MSVC toolchain, resource files are (usually) compiled to an arch-neutral .res format. Always explicitly provide a '/MACHINE:' argument to avoid it guessing incorrectly when cross-compiling.
* | compilers: Update comment about library search patternsNirbheek Chauhan2019-03-141-2/+4
| |
* | compilers: Try harder to dedup builtin libsNirbheek Chauhan2019-03-141-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.
* | Add static as keyword to find_libraryNiklas Claesson2019-03-111-16/+19
| |
* | Fix _get_patterns on OpenBSDAntoine Jacoutot2019-03-111-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')
* | Add warning level zerojml17952019-02-191-6/+11
| |