summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
AgeCommit message (Collapse)Author
2022-10-24basic support for oneapi compilersRobert Cohn
2022-09-19pylint: enable consider-using-inDylan Baker
2022-09-07compilers: correct the MSVC version comparison for turning on __cplusplusEli Schwartz
We compared a Visual Studio (the IDE) version, but we wanted a MSVC (the compiler) version. This caused the option to be passed for a few too many versions of MSVC, and emit a "D9002 : ignoring unknown option" on those systems. Compare the correct version using the version mapping from https://walbourn.github.io/vs-2017-15-7-update/ Fixes #10787 Co-authored-by: CorrodedCoder <38778644+CorrodedCoder@users.noreply.github.com>
2022-07-03move various unused typing-only imports into type-checking blocksEli Schwartz
2022-05-19Fix invalid Python overridesTristan Partin
- mismatched method type - mismatched parameter names
2022-05-08compilers/c++: Add MSVC option to make the __cplusplus define accurateEli Schwartz
Otherwise it always returns the value for c++98, starting with MSVC 2017 15.7 or later. Earlier versions are not affected by this mis-feature. See: https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160 This was originally applied as 0b97d585480e973d8b149618901f7a4ddfa1a906 but later reverted because it made the CI red. Try it again, now. Original-patch-by: Dylan Baker <dylan@pnwbakers.com> Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-03-22OptionOverrideProxy: Make it immutable to avoid copiesXavier Claessens
It is always used as an immutable view so there is no point in doing copies. However, mypy insist it must implement the same APIs as Dict[OptionKey, UserOption[Any]] so keep faking it.
2022-03-16fix detection of language standard library pathsPaolo Bonzini
The code in the C++ and Fortran compilers' language_stdlib_only_link_flags method is broken and cannot possibly have ever worked. Instead of splitting by line, it splits by whitespace and therefore, instead of the last line of the compiler output: programs: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin libraries: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0 it is only the last field that has its first 11 characters removed. Instead of reinventing the wheel with a new and brittle pattern, reuse get_compiler_dirs. Fixes: 64c267c49 ("compilers: Add default search path stdlib_only_link_flags", 2021-09-25) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-02-02Genericise TI compiler and add MSP430 supportWilliam Toohey
2022-01-10compilers: push the compiler id to a class variableDylan Baker
It really is a per class value, and shouldn't be set per instance. It also allows us to get rid of useless constructors, including those breaking mypy
2022-01-03armltdclang: add support for ARM Ltd.'s `armclang` toolchainBen Boeckel
This is another toolchain also called `armclang`, but it is not a cross compiler like Keil's `armclang`. It is essentially the same as `clang` based on its interface and CMake's support of the toolchain. Use an `armltd` prefix for the compiler ID. Fixes: #7255
2021-12-16armclang: clarify that this is support for the Keil cross-compilerBen Boeckel
2021-11-14Remove incorrect arguments for C2000 C++ compiler. Add correct form for ↵Nathanael Gray
output and include args.
2021-11-01various manual conversion of percent-formatted strings to f-stringsEli Schwartz
2021-10-27fix various flake8 whitespace errorsEli Schwartz
2021-10-24Add stdc++20 support for Visual Studio 2019 v16.11Moroz Oleg
fix #9242
2021-10-10Fix typos discovered by codespellChristian Clauss
2021-10-04fix extra whitespaceEli Schwartz
discovered via flake8 --select E303
2021-09-29compilers/elbrus: Deal with C/C++/Fortran stds more correctlymakise-homura
2021-09-29compilers/elbrus: Fix incorrect inheritance model of Elbrus*Compilermakise-homura
2021-09-25compilers: Add default search path stdlib_only_link_flagsDylan Baker
This should be done in all cases of language_stdlib_only_link_flags, but I don't have access to all of the compilers to test it. This is required in cases where object files created by gfortran are linked using another compiler with a differen default search path, such as gfortran and clang together.
2021-09-24pylint: check for duplicate importsDylan Baker
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
2021-08-31pylint: turn on superflous-parensDylan Baker
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-16compilers: Fix extra_args parameterDylan Baker
which can also be a callable taking a CompileChekcMode as an argumetn and returning a list of strings.
2021-08-15Revert "compilers/c++: Add MSVC option to make the __cplusplus define accurate"Jussi Pakkanen
This reverts commit 0b97d585480e973d8b149618901f7a4ddfa1a906.
2021-08-11compilers/c++: Add MSVC option to make the __cplusplus define accurateDylan Baker
Otherwise it always returns the value for c++98, starting with MSVC 2017 15.7 or later. Earlier versions are not affected by this mis-feature
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz
2021-03-19split program related classes and functions out of dependenciesDylan Baker
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-09Add address sanitizer support for Visual Studio.Jussi Pakkanen
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz
performed by running "pyupgrade --py36-plus" and committing the results
2021-01-11move handling of CFLAGS and friends to environmentDylan Baker
This has a bunch of nice features. It obviously centralizes everything, which is nice. It also means that env is only re-read at `meson --wipe`, not `meson --reconfigure`. And it's going to allow more cleanups.
2021-01-04use OptionKey for builtin and base optionsDylan Baker
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04move OptionKey to mesonlibDylan Baker
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker
2021-01-04Add choices to OptionProxyDylan Baker
they're probably not strictly needed, but it makes mypy happy.
2020-12-10compilers: add support for c++20/gnu++20Florian Schmaus
Fixes #8084.
2020-11-12compilers: define standards in the base language compilerDylan Baker
And then update the choices in each leaf class. This way we don't end up with another case where we implicitly allow an invalid standard to be set on a compiler that doesn't have a 'std' setting currently.
2020-11-12compilers: Standardize the names of compiler optionsDylan Baker
Most options don't use language prefaced options (std vs c_std) internally, as we don't need that due to namespacing. Let's do that across the board
2020-10-06compilers: Enable C++20 for Intel C++ Compiler.Vinson Lee
Intel C++ Compiler 19.1 has C++20 features. https://software.intel.com/content/www/us/en/develop/articles/intel-c-compiler-191-for-linux-release-notes-for-intel-parallel-studio-xe-2020.html Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2020-10-01compilers/icl fix IntelClCPP argument checkingDylan Baker
Unlike MSVC and ClangCl it needs to call into it's own compiler check args
2020-10-01compilers: move get_compile_check_args() to CompilerDylan Baker
This is groundwork to put _build_wrapper in the base Compiler, which is needed to make the D compilers truly type safe.
2020-10-01compilers/cpp: Add type annotationsDylan Baker
2020-09-24compilers: make is_cross part of the base Compiler classDylan Baker
Every class needs to set this, so it should be part of the base. For classes that require is_cross, the positional argument remains in their signature. For those that don't, they just allow the base class to set their value to it's default of False.
2020-09-24compilers: make sanity_check_impl a protected methodDylan Baker
It's an implementation detail after all
2020-08-22Merge pull request #7447 from scivision/nvcJussi Pakkanen
Add support for NVidia HPC SDK compilers
2020-08-20Correctly determine C++ stds for Elbrus compilermakise-homura
2020-07-19fix msvc not recognising b_ndebugElliot Haisley
fixes #7404
2020-07-13add Nvidia HPC SDK compilersMichael Hirsch, Ph.D
2020-05-22compilers: add fetching of define list for clangYevhenii Kolesnikov
Simmilar to gcc, the list of pre-processor defines can be fetched with `-dM -E` option. The way cpu_family is determined on linux relies on this list. Fixes incorrect value of cpu_family on linux, when crosscompiling: ``` CC="clang -m32" meson ./build ``` Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com> Co-authored-by: Dylan Baker <dylan@pnwbakers.com>