summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
Commit message (Collapse)AuthorAgeFilesLines
* 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-1/+2
|
* 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 (v)c++latest to VC_VERSION_MAPRobin Kertels2019-07-081-0/+2
|
* compilers/cpp: Fix removal of name from Combo options for Armclangsompen2019-06-111-2/+1
|
* 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.
* UserOption no longer has a name field.John Ericson2019-05-151-27/+17
| | | | | | | 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.
* Merge pull request #5331 from dcbaker/iclJussi Pakkanen2019-05-141-34/+77
|\ | | | | ICL (Intel for Windows) support
| * compilers: Add basic ICL abstractionsDylan Baker2019-05-131-0/+13
| |
| * 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/cpp: Split code out of VisualStudioLikeCPPCompiler for treating ↵Dylan Baker2019-05-131-30/+60
| | | | | | | | | | | | | | | | | | | | c++11 as c++14 This restrictuion exists for MSVC and clang-cl, but not for ICL which actually does support C++11 as a distinct standard. This commmit pulls that behavior out into a mixin class for ClangClCPPCompiler and VisualStudioCPPCompiler, as well as moving the MSVC specific functionality into the VisualStudioCPPCompiler class.
| * compilers: make keyword args to Compiler.compile keyword onlyDylan Baker2019-05-101-1/+1
| | | | | | | | | | Becuase treating args as either keyword or positional makes inheritance really awful to work with.
* | Allow MSVC-style `cpp_eh` for backwards-compatibility purposesnicole mazzuca2019-05-131-12/+22
|/
* Merge pull request #5339 from dcbaker/clikeJussi Pakkanen2019-05-051-37/+47
|\ | | | | Split up the representations of the C and C++ compilers
| * compilers: Split C-Like functionality into a mixin classesDylan Baker2019-05-031-33/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+1
| | | | | | | | This reverts commit 3a75bb5259abbcae820b47f5f4633c564411893b.
* | add -fno-exceptions if cpp_eh=none is specified nicole mazzuca2019-05-051-8/+38
|/
* Merge pull request #4952 from mensinda/cacheCompilesDylan Baker2019-05-021-5/+6
|\ | | | | Cache compilers.compile() in coredata
| * Print '(cached)' when compiler result was cachedDaniel Mensinger2019-04-281-5/+6
| |
* | Add some type annotations and fix lintsJohn Ericson2019-05-021-1/+0
| | | | | | | | | | | | Some things, like `method[...](...)` or `x: ... = ...` python 3.5 doesn't support, so I made a comment instead with the intention that it can someday be made into a real annotation.
* | detect Intel ICL on windowsMichael Hirsch, Ph.D2019-04-271-1/+8
| | | | | | | | 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
* Fix indentationmakise-homura2019-04-191-3/+3
|
* Add -std= remap support for Elbrus compilermakise-homura2019-04-191-2/+2
|
* Handle cpp_debugstl option for Elbrus compilermakise-homura2019-04-191-2/+5
|
* Add warning level zerojml17952019-02-191-4/+8
|
* Add PGI C and C++ compilers (#4803)Michael Hirsch, Ph.D2019-01-211-0/+8
|
* Store the target architecture for CL-like compilersJon Turney2018-12-061-4/+4
| | | | | | | | | | | | | | | | | 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()
* 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
* compilers: Use keyword only arguments for compiler interfacesDylan Baker2018-11-131-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | Because we need to inherit them in some cases, and python's keyword-or-positional arguments make this really painful, especially with inheritance. They do this in two ways: 1) If you want to intercept the arguments you need to check for both a keyword and a positional argument, because you could get either. Then you need to make sure that you only pass one of those down to the next layer. 2) After you do that, if the layer below you decides to do the same thing, but uses the other form (you used keyword by the lower level uses positional or vice versa), then you'll get a TypeError since two layers down got the argument as both a positional and a keyword. All of this is bad. Fortunately python 3.x provides a mechanism to solve this, keyword only arguments. These arguments cannot be based positionally, the interpreter will give us an error in that case. I have made a best effort to do this correctly, and I've verified it with GCC, Clang, ICC, and MSVC, but there are other compilers like Arm and Elbrus that I don't have access to.
* Add support for Renesas CC-RX toolchainPhillip Cao2018-11-081-0/+29
|
* Qualify checks of self.version by self.id in VisualStudioC/CPPCompilerJon Turney2018-11-041-7/+10
|
* Detect clang-cl as msvc-like, not clang-likeJon Turney2018-11-041-1/+5
| | | | | | | | | | | | | | | | | Handle clang's cl or clang-cl being in PATH, or set in CC/CXX Future work: checking the name of the executable here seems like a bad idea. These compilers will fail to be detected if they are renamed. v2: Update compiler.get_argument_type() test Fix comparisons of id inside CCompiler, backends and elsewhere v3: ClangClCPPCompiler should be a subclass of ClangClCCompier, as well Future work: mocking in test_find_library_patterns() is effected, as we now test for a subclass, rather than self.id in CCompiler.get_library_naming()
* Generalize gnulike-targeting-windows checks.Josh Gao2018-10-301-2/+2
| | | | | | | | | Replace several checks against GCC_MINGW or (GCC_MINGW, GCC_CYGWIN) with is_windows_compiler instead, so that clang and other gcc-like compilers using MinGW work appropriately with vs_module_defs, c_winlibs, and cpp_winlibs. Fixes #4434.
* add support for `/permissive-`Nicole Mazzuca2018-10-271-8/+21
| | | | | We do this with `std_ver=vc++NM` - `vc++` does not add `/permissive-`, while `std_ver=c++NM` adds `/permissive-`.
* add cpp_std support for MSVCNicole Mazzuca2018-10-221-3/+34
|
* Adding "compiler_type" flag to ARM compilers.Mohammed Amer Khalidi2018-10-071-4/+4
|
* Abstract shared GCC/Clang/ICC methods in GnuLikeCompilerDavid Seifert2018-09-171-4/+0
|
* Fix ICC on macOSDavid Seifert2018-09-161-4/+15
|
* Use enum instead of `int` for compiler variantsDavid Seifert2018-09-161-12/+12
| | | | | | | | * Enums are strongly typed and make the whole `gcc_type`/`clang_type`/`icc_type` distinction redundant. * Enums also allow extending via member functions, which makes the code more generalisable.
* Add method to check for C/C++ function attributesDylan Baker2018-09-071-0/+6
| | | | | | | | | | | | | | | It's fairly common on Linux and *BSD platforms to check for these attributes existence, so it makes sense to me to have this checking build into meson itself. Autotools also has a builtin for handling these, and by building them in we can short circuit cases that we know that these don't exist (MSVC). Additionally this adds support for two common MSVC __declspec attributes, dllimport and dllexport. This implements the declspec version (even though GCC has an __attribute__ version that both it and clang support), since GCC and Clang support the MSVC version as well. Thus it seems reasonable to assume that most projects will use the __declspec version over teh __attribute__ version.
* Make `-std=` fallback remapping more robustDavid Seifert2018-08-291-11/+54
| | | | | | | | | | * The current version matching logic is brittle with respect to Clang. LLVM and Apple Clang use slightly different but nowadays overlapping version ranges. Instead, we now just check whether the compiler supports the given `-std=` variant and try its respective fallback instead of testing version ranges.