summaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/toolchain.py
AgeCommit message (Collapse)Author
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-05-23cmake: Fix toolchain including unsupported languagesL. E. Segovia
The most egregious cases are Nasm (which needs to be transformed to `ASM_NASM`) and Rust (which is not yet supported by CMake). See https://cmake.org/cmake/help/v4.0/command/project.html
2025-04-02compilers: introduce get_exe() and get_exe_args()Paolo Bonzini
This will be used by rustdoc tests because the Test objects takes a single string for the command and everything else goes in the args. But apart from this, the need to split the executable from the arguments is common so create new methods to do it. While at it, fix brokenness in the handling of the zig compiler, which is checking against "zig" but failing to detect e.g. "/usr/bin/zig". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-11-04CMakeToolchain: Log output on compiler state failureFrank Richter
2024-10-11toolchain.py minimum CMake 3.10 to avoid deprecation warningscivision
ref: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9875
2024-10-04Turn off CMake compile launcher when using zigElliott Sales de Andrade
This setting is for things like `ccache`, but if Meson treats zig that way, then it will expand the second argument to become: ``` /usr/bin/zig /usr/lib64/ccache/cc ``` in CMake and `/usr/lib64/ccache/cc` is _not_ an argument to `zig`. If you run ``` $ CC='zig cc' CXX='zig c++' ./meson.py setup 'test cases/cmake/1 basic' build ``` then CMake will fail to compile a "simple test program" and setup fails.
2024-08-08Fix compiling ObjC/ObjC++ on Windows/MinGWJonathan Schleifer
Co-Authored-By: L. E. Segovia <amy@amyspark.me>
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-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2022-09-19compilers: don't use instance checks to determine propertiesEli Schwartz
In various situations we want to figure out what type of compiler we have, because we want to know stuff like "is it the pgi one", or "does it use msvc style". The compiler object has this property already, via an API specifically designed to communicate this info, but instead we performed isinstance checks on a compiler class. This is confusing and indirect, and has the side effect of requiring more imports everywhere. We should do away with it.
2022-08-26Fix purely white space issues reported by flake8Alf Henrik Sauge
2022-07-03move various unused typing-only imports into type-checking blocksEli Schwartz
2022-01-23cmake: Add TARGET_ generator expression support (fixes #9305)Daniel Mensinger
2021-10-08cmake: handle arguments in the [binaries] section of the machine filePaolo Bonzini
Sometimes, the machine file can include compiler command line options, in order to pick the correct multilib. For example, Meson uses "$cc --print-search-dirs" to find the library search path, where $cc is the cc from the machine file. Because the outputs of "gcc -m32 --print-search-dirs" and "gcc --print-search-dirs" are different, this only works if you have [binaries] cc = ['gcc', '-m32'] in the machine file. Right now, however, the cmake module assumes that the compiler listed in the machine file is either a compiler, or a "launcher" followed by the compiler. Check if the second argument starts with a slash (for Microsoft-like compilers) or a dash (for everyone else), and if so presume that the CMAKE_*_COMPILER_LAUNCHER need not be defined.
2021-09-14apply flake8 fixes for unused imports and missing importsEli Schwartz
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger
2021-05-30cmake: select correct generator in toolchain.pyDaniel Mensinger
2021-05-29cmake: Fix CMakeToolchain (fixes #8293)Daniel Mensinger
Instead of guessing the internal compiler variables, Meson now runns CMake once to determine what they actually are.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz
performed by running "pyupgrade --py36-plus" and committing the results
2020-11-20use real pathlib moduleDylan Baker
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
2020-10-13cmake: Add cross compilation supportDaniel Mensinger