summaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/interpreter.py
AgeCommit message (Collapse)Author
2025-12-10cmake: Fix version kwarg being added to static_library targetsRobotLeopard86
2025-10-24cmake: Set CMAKE_INSTALL_LIBDIR explicitlyDaniele Nicolodi
CMake and Meson may disagree on the default value of the libdir installation path. This results in shared libraries installed in the default location not assigned to the {libdir_shared} install location by the Meson CMake interpreter. This results in wrong install plan metadata and in those libraries being installed in the wrong location. Fixes #12960.
2025-10-24cmake: Do not pass install prefix explicitly to the CMake interpreterDaniele Nicolodi
There is no point in doing so as it can be readily obtained from the environment. This in preparation of extracting more installation location from the environment.
2025-09-06compilers: Enable out-of-the-box MSVC compatibility with ccacheL. E. Segovia
ccache has been for a long time compatible with MSVC (since 4.6) but when using debug mode, the /Z7 flag must be passed instead of /Zi. See https://ccache.dev/releasenotes.html#_ccache_4_6
2025-08-26Set version, soversion from cmake if availableJulianne Swinoga
2025-07-18cmake: Use the `cm\_` prefix for names starting with digitsKonstantin Seurer
Avoids errors like `ERROR: Invalid variable name: 16bit_arithmetic_dir`.
2025-06-03cmake: Fix target_link_libraries against project targetsL. E. Segovia
These were supported for shared libraries, but for static libraries the link_with property was never populated with `LINK_LIBRARIES` or `INTERFACE_LINK_LIBRARIES`. Fixes #13101
2025-04-05cmake/interpreter: Don't add __CMake_build to includesTomi Lähteenmäki
Don't add "<project_source_dir>/<subproject>/__CMake_build" directory to include directories. Fixes #12351
2025-04-04cmake: filter and order clib_compiler languagesAndrei Alexeyev
2025-04-04cmake: pass clib_compiler to resolve_cmake_trace_targets()Andrei Alexeyev
This is required to resolve ambiguous LINK_LIBRARIES passed as bare names.
2025-03-10coredata: replace get_option with optstore.get_value_forDylan Baker
This is an old method, that is now just a wrapper around the OptionStore method, that doesn't add any value. It's also an option related method attached to the CoreData instead of the OptionStore, so useless and a layering violation.
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.
2024-09-12cmake: actually print the cycle in the error messageDylan Baker
2024-09-11Fix typosspaette
2024-08-26cmake/interpreter: Remove None from values we promise wont have NoneDylan Baker
We've documented these lists as being `List[Path]`, but then we have the potential to insert a None into them via the `rel_path()` function, which can return `None` in some cases. Currently we fix some (but not all) of these later, but we should actually remove them from the list before we assign, so that it's actually a `List[Path]` at all times. While we're here I've simplified the logic a bit. Closes: #13551
2024-08-26cmake/interpreter: Fix some incorrect and missing annotationsDylan Baker
2024-08-26cmake/interpreter: clear up some ambiguous Optional handlingDylan Baker
It may have all been correct, but mypy and pyright couldn't be sure of that.
2024-07-17Remove language (AKA compiler) type from OptionKey.Jussi Pakkanen
2024-07-15cmake: Only propagate interface link flags in depJonathon Anderson
CMake has two target properties, LINK_OPTIONS and INTERFACE_LINK_OPTIONS. The former is for link flags that apply only to the target (PRIVATE). The latter is used for link flags that propagate to dependents (PUBLIC or INTERFACE). Meson currently propagates all flags, PUBLIC and PRIVATE, as part of the generated dependency() which causes problems when some of the private flags are highly disruptive, e.g. `-Wl,--version-script`. Tease apart the two kinds of link flags and, for non-static libraries, only propagate the PUBLIC/INTERFACE flags and not the PRIVATE ones.
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen
2024-04-24cmake/interpreter: Annotate and style module-level constantsJouke Witteveen
2024-04-11cmake: best-effort build type propagationJouke Witteveen
2024-01-16cmake: Fix blunt target filtering skipping GENERATED dependenciesL. E. Segovia
GENERATED files can be used as dependencies for other targets, so it's misguided (at best) to filter them with a blunt whitelist. However, there does exist an extension that needs to be skipped: on Windows + MSVC, CMake will by default try to generate a Visual Studio project, and there dependencies with no inputs are instead tied to a dummy .rule input file which is created by the generation step. The fileapi will still report those, so it will cause Meson to bail out when it realises there's no such file in the build tree. Fixes #11607
2023-12-21cmake/interperter: Add missing type annotationDylan Baker
Which mypy is suddenly complaining about.
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-12cmake: parse project versionNicolas Werner
This properly sets the project version in projects meson generates from cmake projects. This allows dependency fallbacks to properly check the version constraints in dependency calls when falling back to a cmake subproject. Before this would fail, because the project version was undefined.
2023-09-22CMakeInterpreter: Remove useless argumentsXavier Claessens
2023-09-11parser: simplify other node constructorsCharles Brunet
2023-09-11parser: simplify Assignment and PlusAssignment nodesCharles Brunet
2023-09-11parser: add SymbolNode to preserve operatorsCharles Brunet
2023-09-11parser: use IdNode for function name and assignment nameCharles Brunet
2023-09-11parser: preserve escape chars in stringsCharles Brunet
use separate Node for multiline strings
2023-09-11parser: preserve number baseCharles Brunet
2023-02-01micro-optimize: define typing-only objects in TYPE_CHECKINGEli Schwartz
Union types that exist solely for use as annotations don't need to be created in normal runs.
2022-11-30pylint: enable the set_membership pluginDylan Baker
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
2022-11-24migrate some type comments to modern type annotationsEli Schwartz
flake8 6 upgrades to pyflakes 3, and in turn this means that support for parsing `# type: ` style annotations has been removed. https://github.com/PyCQA/pyflakes/pull/684 This caused one file to fail linting, because it had a typing import which was only used by a type comment. ``` mesonbuild/cmake/interpreter.py:55:5: F401 '.common.CMakeConfiguration' imported but unused ``` Updating it to actual annotations allows pyflakes to detect its usage again, and flake8 passes. Do the whole file while we are here.
2022-11-24remove a couple of unneeded type annotationsEli Schwartz
These are trivially inferred based on their initialized values.
2022-10-04pylint: enable use-a-generatorDylan Baker
This catches some optimization problems, mostly in the use of `all()` and `any()`. Basically writing `any([x == 5 for x in f])` vs `any(x == 5 for x in f)` reduces the performance because the entire concrete list must first be created, then iterated over, while in the second f is iterated and checked element by element.
2022-10-03pylint: enable unnecessary-comprehensionDylan Baker
2022-08-26Fix purely white space issues reported by flake8Alf Henrik Sauge
2022-07-18cmake module: Better warnings and error messages in some cases.Volker Weißmann
2022-07-03move various unused typing-only imports into type-checking blocksEli Schwartz
2022-07-03sort imports for neatnessEli Schwartz
2022-05-24cmake: fix detecting directories as input files (fixes #10244)Daniel Mensinger
2022-04-03cmake: Better error message when configuring a CMake subproject fails.Daniel Mensinger
2022-03-29Fix CMake deprecation warning generated from interpreterTristan Partin
2022-03-07Merge pull request #9743 from mensinda/cmakeGeneratorFixedJussi Pakkanen
cmake: Add TARGET_ generator expression support (fixes #9305)
2022-02-03cmake: Deprecate CMake <3.17 supportDaniel Mensinger