summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
| |
* | Remove cross_info; cross file is parsed up front and discardedJohn Ericson2019-01-021-1/+1
|/
* Store the target architecture for CL-like compilersJon Turney2018-12-061-4/+5
| | | | | | | | | | | | | | | | | Store the MSVC compiler target architecture ('x86', 'x64' or 'ARM' (this is ARM64, I believe)), rather than just if it's x64 or not. The regex used for target architecture should be ok, based on this list of [1] version outputs, but we assume x86 if no match, for safety's sake. [1] https://stackoverflow.com/a/1233332/1951600 Also detect arch even if cl outputs version to stdout. Ditto for clang-cl Future work: is_64 is now only used in get_instruction_set_args()
* Remove linkerlike args from compile checks. Closes #4542.Jussi Pakkanen2018-11-271-1/+7
|
* Fix flake8 'imported but unused' reportsJon Turney2018-11-191-1/+0
| | | | | | | $ flake8 | grep F401 ./run_unittests.py:43:1: F401 'mesonbuild.mesonlib.is_linux' imported but unused ./mesonbuild/compilers/c.py:32:1: F401 '.compilers.CompilerType' imported but unused ./mesonbuild/compilers/cpp.py:23:1: F401 '.compilers.CompilerType' imported but unused
* Merge pull request #4359 from dcbaker/icc-fixesDylan Baker2018-11-171-25/+11
|\ | | | | ICC fixes for Linux and MacOS
| * compilers: quiet ICC messages about pchDylan Baker2018-11-151-1/+1
| | | | | | | | | | These are useful for debugging, but not interesting for end users, where it just adds lines between ninja jobs without adding value.
| * compilers: Move get_allow_undefined_link_args to CompilerDylan Baker2018-11-151-26/+6
| | | | | | | | | | | | | | This allows each implementation (gnu-like) and msvc to be implemented in their respective classes rather than through an if tree in the CCompiler class. This is cleaner abstraction and allows us to clean up the Fortran compiler, which was calling CCompiler bound methods without an instance.
| * compilers: Set the correct values for undefined modules on apple with iccDylan Baker2018-11-151-1/+5
| |
| * compilers: Add ICC setting for get_allow_undefined_link_argsDylan Baker2018-11-151-0/+2
| |
| * compilers: fix compiler.compile for Intel CompilersDylan Baker2018-11-151-4/+4
| | | | | | | | | | has_arguments is the wrong thing to fix, since all checks that require compiler options are based on compiles, it's the right thing to modify.
* | Guard against broken lib paths returned by gcc.Jussi Pakkanen2018-11-171-3/+6
|/