summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/fortran.py
AgeCommit message (Collapse)Author
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.get_compiler_dirsDylan Baker
2025-11-19compilers: Remove Environment parameter from ↵Dylan Baker
CLikeCompiler._get_basic_compiler_args
2025-11-19compilers: Remove Environment parameter from CLikeCompiler.output_is_64bitDylan Baker
2025-11-19Compilers: make CLikeCompiler.cross_compute_int privateDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.compute_intDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_std_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_headerDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.runDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.cached_runDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.sizeofDylan Baker
This also fixes the `_cross_sizeof` helper
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 Compiler.has_multi_argumentsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.openmp_flagsDylan Baker
I've done the compile and link flags in one commit since they're so closely related
2025-11-19compilers: Remove Environment parameter from ↵Dylan Baker
Compiler.get_language_stdlib_only_link_flags
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-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-06-27compilers-fortran: Fix preprocessing when fortran uses concat operatorAndrew Lister
2025-06-06Fix Flang stdlib linking for LLVM toolchain versions >= 19Mugundanmcw
2025-05-21compilers: add option for ignoring system dirsDavid Seifert
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-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.
2024-10-26Reimplement several methods for Fortran compilersSébastien Villemot
The output_is_64bit, sizeof, cross_sizeof, compute_int and cross_compute_int methods are reimplemented for Fortran compilers. Those inherited from CLikeCompiler do not work since they assume C or C++. Note that those tests rely on Fortran 2008 features (notably the c_sizeof operator). Closes #12757
2024-10-01compilers: remove hasattr for `file_suffixes`Dylan Baker
This is used in exactly two cases, and it's just not worth it. Those two cases can override the default set of extensions, and in the process allow a nice bit of code cleanup, especially toward type checking.
2024-07-28add initial support for llvm-flangH. Vetinari
2024-07-12Rename langopt methodJussi Pakkanen
The public facing name of language options is compiler option, so let's standardise on that.
2024-06-26compilers: pass Environment to openmp_flagsDylan Baker
This will be needed by the Apple compiler
2024-06-16BUG: Use an F77 snippet for sanity testing FortranRohit Goswami
Closes gh-13319
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-08Use helper method in Fortran compiler classes.Jussi Pakkanen
2024-05-23Refactor option classes to their own file.Jussi Pakkanen
2024-04-27compilers/fortran: fix werror options for Intel compilersBenjamin Gilbert
Unlike in the Intel C compiler, -Werror and /WX are not accepted.
2024-03-15Improve error messages for invalid option valuesCharles Brunet
By adding the option name to UserOption object, it is now possible to display the name of the affected option when the given option value is not valid. Fixes #12635
2024-03-15compilers: No need to pass exe_wrapper everywhereXavier Claessens
Places where compiler needs it already have access to Environment object and can use it directly. This fixes mypy complaining that not all compilers have self.exe_wrapper in run() method that got moved to base class.
2023-12-23Remove `get_buildtype_args` functionCharles Brunet
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See #10808. Relates to: - #11645 - #12096 - #5920 - #5814 - #8220 - #8493 - #9540 - #10487 - #12265 - #8308 - #8214 - #7194 - #11732
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-12-05compilers: drop dead codeEli Schwartz
no_warn_args is unused. Its only purpose was to implement automatic hiding of UB in transpiled code, and it was not used at all in languages other than C/C++ -- specifically when the C/C++ source files were created by transpiling from vala or cython.
2023-07-12Annotate naked fundamental Python typesTristan Partin
Although mypy wasn't complaining, pyright was.
2023-07-12Use CompileCheckMode enumTristan Partin
There were a ton of naked strings with TODOs telling us to use the enum.
2023-06-26linkers: delay implementations import until detect is runEli Schwartz
This saves on a 1500-line import at startup and may be skipped entirely if no compiled languages are used. In exchange, we move the implementation to a new file that is imported instead. Followup to commit ab20eb5bbc21ae855bcd211131132d2778602bcf.