summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cpp.py
AgeCommit message (Collapse)Author
2025-12-08compilers/nvidia_hpc: compilers: move -std options to get_option_std_argsZephyr Lykos
Fixes: 6c88d9992192379511c4777c526786cbacf06167 Fixes: d3542ff690d0be723cfd3ebfaaac99290517837f Fixes: ff0c758b2a8015f7e7ca6fc627c29ef7bb4771b3
2025-11-23Add import std support to MSVC.Jussi Pakkanen
2025-11-23Add cpp_importstd option.Jussi Pakkanen
The reason it is a string array is that this allows us to add more values than true/false should it be needed. For an example see `b_lto`.
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.get_compiler_dirsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_compile_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_std_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_link_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_headerDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_header_symbolDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_functionDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.find_libraryDylan Baker
2025-11-19compilers: Remove Environment parameter from ↵Dylan Baker
Compiler.get_language_stdlib_only_link_flags
2025-11-19compilers: Remove Environment parameter from Compiler.get_assert_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.sanity_checkDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.compiles()Dylan Baker
2025-11-19compilers: Remove Environment parameter from get_compileropt_valueDylan Baker
2025-11-19compilers: Stop passing `is_cross`Dylan Baker
This is calculated by `Environment().is_cross_build(for_machine)`. Since we have that in the Compiler class, just calculate it in the Compiler initializer
2025-11-19compilers: Pass Environment instead of MachineInfoDylan Baker
We end up needing it everywhere, so just store it. This patch is huge already, so it's just the conversion to passing Environment, more cleanups to come.
2025-11-09Fix inverted RTTI logic in Intel C++ compilerTudor Gradinaru
The IntelCPPCompiler was incorrectly adding -fno-rtti when RTTI was enabled (rtti=True) instead of when it was disabled. This change corrects the logic to match the behavior of GCC and Clang compilers, which properly add -fno-rtti when rtti=False. Fixes #15220
2025-10-31compilers: cpp: unset LIBCPP_HARDENING_MODE first for debugstlSam James
libc++ uses the same macro name, just with different values, for debugstl. If the distro or similar predefines a hardening mode lower than the mode debugstl wants (or in any other way not equal), we get an annoying redefinition warning. Closes: https://github.com/mesonbuild/meson/issues/13812
2025-10-31compilers: cpp: explain more wrt GCC versions vs assertionsSam James
Bug: https://github.com/mesonbuild/meson/issues/13978
2025-10-31compilers: cpp: stop trying to handle old libc++ for assertionsSam James
This has two problems: 1) it keeps breaking with Apple Clang (bug #14440, bug #14856) 2) it gets confused when using GCC with libc++ (a rare configuration) because compiler version != libc++ version There's no reason to keep catering for old libc++ here. The feature was somewhat immature in older libc++ anyway. Just rip it out and then we can go back and restore it for the niche case later. Bug: https://github.com/mesonbuild/meson/issues/14440 Bug: https://github.com/mesonbuild/meson/issues/14856 Closes: https://github.com/mesonbuild/meson/issues/13978
2025-10-31compilers: cpp: add comment wrt GCC -stdlib=libc++ caseSam James
It's not obvious so add a comment, lest someone think handling the case is a bug.
2025-10-29compilers: add Microchip XC32 compilerLiza Chevalier
The Microchip XC32 compiler is a GCC-based compiler implemented using existing GNU compiler classes. As the XC32 version and GCC version do not match mixins have been implemented to override versions used in versions checks where applicable.
2025-10-29compilers/nvidia_hpc: support C/C++ -stdEisuke Kawashima
2025-10-06Revert "compilers: refactor sanity checking code"Dylan Baker
This reverts commit 806289a5d27958a084bc6cba41b7cf9ccee4ecf4.
2025-10-06compilers: refactor sanity checking codeDylan Baker
The goal is to reduce code duplication, and allow each language to implement as little as possible to get good checking. The main motivation is that half of the checks are fragile, as they add the work directory to the paths of the generated files they want to use. This works when run inside mesonmain because we always have an absolute build directory, but when put into run_project_tests.py it doesn't work because that gives a relative build directory.
2025-08-07cpp: handle Apple Clang deprecation of hardening macro for old versions tooSam James
a16ec8b0fb6d7035b669a13edd4d97ff0c307a0b changed the threshold to 17 for Apple Clang, but it needs to be 16 instead. Bug: https://github.com/mesonbuild/meson/issues/14440 Closes: https://github.com/mesonbuild/meson/issues/14856
2025-05-13cpp: Fix cpp_std=vc++14Peter Harris
Fixes a regression introduced in commit d37d649b08b8 "Make all Meson level options overridable per subproject." This change results in every file printing the warning "cl : Command line warning D9002 : ignoring unknown option '/std:vc++14'" Now that "get_option_..." is called before overwriting the option (instead of after), we have to operate on compiler options, not meson options. There is no such compiler option as /std:vc++14 (the meson option vc++xx is split into /std:c++xx for the C++ standard version, and a separate flag that enables Microsoft extensions). Remove the mapping from c++14 to vc++14.
2025-05-02cpp: fix _LIBCPP_ENABLE_ASSERTIONS warningMartin Dørum
libc++ deprecated _LIBCPP_ENABLE_ASSERTIONS from version 18. However, the libc++ shipped with Apple Clang backported that deprecation in version 17 already, which is the version which Apple currently ships for macOS. This PR changes the _LIBCPP_ENABLE_ASSERTIONS deprecation check to use version ">=17" on Apple Clang.
2025-04-08coredata: move MutableKeyedOptionDict to optionsDylan Baker
2025-04-04compilers: move -std options to get_option_std_args, special-casing CUDAPaolo Bonzini
Move building the -std option to the new get_option_std_args method, special casing CUDA to never include the option from the host compiler. This fixes again #8523, which was broken by the option refactoring (unsurprisingly, since the fix was ripped out unceremoniously without a replacement). Fixes: #14365 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-04compilers: remove useless get_option_compile_argsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-03-10coredata: remove get_option_for_subprojectDylan Baker
This is just a wrapper around `OptionStore.get_option_for`, but without taking an `OptionKey`. This complicates the subproject passing, since `OptionKey` is designed to encapsulate the option name and subproject.
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2025-02-05options: Add an EnumeratedUserOption classDylan Baker
This will allow us to take choices out of the UserOption class, which doesn't actually use this attribute.
2025-02-05options: use dataclasses for UserOptionDylan Baker
This reduces code, makes this clearer, and will be a nice step toward the goal of getting everything typesafe. For `UserIntegerOption` this makes a fairly nice, but substantial change in that the old method used a tuple of `(min, value, max)` to pass to the initializer, while all other types just passed `value`. The new `UserIntegerOption` does the same, with keyword arguments for the min and max values.
2025-02-05compilers: remove Compiler.create_optionDylan Baker
This saves a *tiny* bit of typing, but at the cost of requiring either the current solution of throwing up our hands and saying "typing is too hard, better to have bugs!" or an extensive amount of `TypedDict`s, `overloads`, and a very new version of mypy. Let's get our type safety back, even if it means writing a little bit more code.
2025-02-05compilers: use super().get_options() instead of CompilerClass.get_options()Dylan Baker
Because the latter doesn't always interact with the MRO correctly.
2025-02-05compilers: fix the UserStdOption name of the C and C++ compilersDylan Baker
2025-01-28Merge pull request #13642 from dcbaker/submit/fix-objc-standardsJussi Pakkanen
Support lists for ObjC and ObjC++ standards
2025-01-28compilers/clang++: Add `-fpch-instantiate-templates` to speed up clang++ buildsinsunaa
- see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5168
2025-01-27compilers: split Apple C++ version handling to a mixinDylan Baker
2025-01-27compilers/gnu: Split Gnu C++ standard handling into a mixin classDylan Baker
So we can re-use it in the ObjC++ standards
2025-01-27compilers/objcpp: Use shared C++ standards with ClangCPPStandardDylan Baker
2025-01-27compilers/clang: split the Std handling for C++ out of the ClangCPPCompilerDylan Baker
We'll want to use this for the ObjC++ compiler too.
2025-01-15Fix minimum required Apple clang version for C++26Nikolai Vavilov
2025-01-08Update cpp language list for intel compiler on windowsborg323
2024-10-21compilers: Fix inconsistent option descriptionsDavid Robillard
Remove trailing periods for consistency with other option descriptions, and use a consistent description for `winlibs` options everywhere (the one in the documentation).
2024-10-11Add options for standard parameter for nvc and nvc++Kevin Meagher
fixes #13271