summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins/islinker.py
AgeCommit message (Collapse)Author
2025-12-01compilers: pass target to get_lto_*_argsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_link_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.sanitizer_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_multi_argumentsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.build_rpath_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.thread_flagsDylan Baker
Same logic as the openmp flags
2025-11-19compilers: Remove Environment parameter from Compiler.get_soname_argsDylan Baker
2025-11-12compilers: pass target and env to sanitizer_*_argsPaolo Bonzini
The Rust compiler will need these to check the rust_nightly option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01call determine_rpath_dirs only when linker requires itCharles Brunet
2025-03-09compilers: convert `b_sanitize` to a free-form array optionPatrick Steinhardt
In the preceding commit we have started to perform compiler checks for the value of `b_sanitize`, which allows us to detect sanitizers that aren't supported by the compiler toolchain. But we haven't yet loosened the option itself to accept arbitrary values, so until now it's still only possible to pass sanitizer combinations known by Meson, which is quite restrictive. Lift that restriction by adapting the `b_sanitize` option to become a free-form array. Like this, users can pass whatever combination of comma-separated sanitizers to Meson, which will then figure out whether that combination is supported via the compiler checks. This lifts a couple of restrictions and makes the supporting infrastructure way more future proof. A couple of notes regarding backwards compatibility: - All previous values of `b_sanitize` will remain valid as the syntax for free-form array values and valid combo choices is the same. We also treat 'none' specially so that we know to convert it into an empty array. - Even though the option has been converted into a free-form array, callers of `get_option('b_sanitize')` continue to get a string as value. We may eventually want to introduce a kwarg to alter this behaviour, but for now it is expected to be good enough for most use cases. Fixes #8283 Fixes #7761 Fixes #5154 Fixes #1582 Co-authored-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Patrick Steinhardt <ps@pks.im>
2025-02-27coredata: delete the OptionsViewDylan Baker
This also makes KeyedOptionDictType obsolete and it's removed
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
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-07-12Fix return type of debugfile functionsTristan Partin
It was returning None in some cases while being marked as returning string.
2023-02-01treewide: add future annotations importEli Schwartz
2022-10-24Fix mismatched param names between Compiler and BasicLinkerIsCompilerMixinTristan Partin
2022-10-13Add b_thinlto_cache for automatically configuring incremental ThinLTOTatsuyuki Ishi
2021-12-30fix type annotations for compiler toolchain rpathsEli Schwartz
We pass around a tuple of rpaths, because rpaths *can* be more than one. But all the annotations said it would be a str instead.
2021-07-14linkers: remove is_shared_module argument to get_soname_argsPaolo Bonzini
The argument is now unused, drop it.
2021-07-05condense linesEli Schwartz
2021-07-05simplify mesonlib imports for the sake of line lengthsEli Schwartz
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz
performed by running "pyupgrade --py36-plus" and committing the results
2021-02-17compilers: Only insert -flto-jobs in clang's link argumentsDylan Baker
Clang has a hand `-Wunused-command-line-argument` switch, which when turned to an error, gets very grump about `-flto-jobs=0` being set in the compiler arguments (although `-flto=` belongs there). We'll refactor a bit to put that only in the link arguments. GCC doesn't have this probably because, a) it doesn't have an equivalent warning, and b) it uses `-flto=<$numthreads. Fixes: #8347
2021-01-04use OptionKey for compiler_optionsDylan Baker
2020-11-17Revert "Add thinlto support. Closes #7493."Jussi Pakkanen
This reverts commit 3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.
2020-11-08Add thinlto support. Closes #7493.Jussi Pakkanen
2020-10-01compilers/cs: Add type annotationsDylan Baker
2020-09-24compilers: Tell mypy that the compiler mixins are just thatDylan Baker
We do this by making the mixins inherit the Compiler class only when mypy is examining the code (using some clever inheritance shenanigans). This caught a bunch of issues, and also lets us delete a ton of code.
2020-09-24compilers/mixins/islinker: Make type safeDylan Baker
2020-07-13Fix native builds on Windows ARM64 machinesNirbheek Chauhan
I made the mistake of always selecting the debug CRT for compiler checks on Windows 4 years ago: https://github.com/mesonbuild/meson/pull/543 https://github.com/mesonbuild/meson/pull/614 The idea was to always build the tests with debugging enabled so that the compiler doesn't optimize the tests away. But we stopped doing that a while ago, and also the debug CRT has no relation to that. We should select the CRT in the same way that we do for building targets: based on the options. On Windows ARM64, the debug CRT for ARM64 isn't always available, and the release CRT is available only after installing the runtime package. Without this, we will always try to pick the debug CRT even when --buildtype=debugoptimized or release.
2020-05-16Let .pc files specify rpath.Dan Kegel
Fixes #4027
2020-03-23Fix legacy env var support with crossJohn Ericson
Fix #3969
2020-02-27compilers/mixins/islinker: Add stubs for thread_*_flagsDylan Baker
2020-02-27compilers/mixins/islinker: Add missing methodDylan Baker
In particular emcc needs this
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger
2019-10-14Implement get_buildtype_linker_args in BasicLinkerIsCompilerMixinAndrei Alexeyev
2019-10-14Implement get_asneeded_args in BasicLinkerIsCompilerMixinAndrei Alexeyev
2019-10-14Implement get_linker_debug_crt_args in BasicLinkerIsCompilerMixinAndrei Alexeyev
2019-10-14Fix misnamed method in BasicLinkerIsCompilerMixinAndrei Alexeyev
get_allow_undefined_link_args is the compiler method get_allow_undefined_args is the linker method
2019-09-05mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy
2019-08-14compilers/mixins: Add a module for mixins for compilers that are linkersDylan Baker
This is currently meant to solve problems for D's DMD compiler, however it may be useful in other cases.