summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
| |
* | Remove get_cross_extra_flagsJohn Ericson2019-02-151-27/+20
| | | | | | | | This is no longer needed, we just remove conditionals around it.
* | Never access environment.properties downstreamJohn Ericson2019-02-021-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead use coredata.compiler_options.<machine>. This brings the cross and native code paths closer together, since both now use that. Command line options are interpreted just as before, for backwards compatibility. This does introduce some funny conditionals. In the future, I'd like to change the interpretation of command line options so - The logic is cross-agnostic, i.e. there are no conditions affected by `is_cross_build()`. - Compiler args for both the build and host machines can always be controlled by the command line. - Compiler args for both machines can always be controlled separately.
* | find_library: Check arch of libraries on DarwinNirbheek Chauhan2019-01-311-6/+22
| | | | | | | | | | | | | | | | | | | | | | macOS provides the tool `lipo` to check the archs supported by an object (executable, static library, dylib, etc). This is especially useful for fat archives, but it also helps with thin archives. Without this, the linker will fail to link to the library we mistakenly 'found' like so: ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
* | Rewrite appleframework and extraframework dependency classesNirbheek Chauhan2019-02-011-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of only doing a naive filesystem search, also run the linker so that it can tell us whether the -F path specified actually contains the framework we're looking for. Unfortunately, `extraframework` searching is still not 100% correct in the case when since we want to search in either /Library/Frameworks or in /System/Library/Frameworks but not in both. The -Z flag disables searching in those prefixes and would in theory allow this, but then you cannot force the linker to look in those by manually adding -F args, so that doesn't work.
* | BUGFIX: broken/missing Fortran code/unit testsMichael Hirsch, Ph.D2019-01-271-2/+3
| |
* | Add PGI C and C++ compilers (#4803)Michael Hirsch, Ph.D2019-01-211-0/+8
| |
* | Add get_werror_args for CCRX C compilerPhillip Cao2019-01-101-0/+3
| |
* | Absolute path generation refactoringDaniel Mensinger2019-01-061-0/+9
| |