aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mcompile.py
AgeCommit message (Collapse)AuthorFilesLines
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen1-2/+3
2024-03-15move UserArrayOption.listify_value to mesonlibCharles Brunet1-3/+2
This function is used at 3 different places and it does not justify it as being a staticmethod instead of being a free function.
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker1-11/+1
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-11-01Add comments suggesting to keep shell completion scripts up-to-date near cmd ↵Luke Elliott1-0/+2
line argument code
2023-10-05mcompile: add suffix as an additional parameterDudemanguy1-5/+35
Since the previous commit allows for more scenarios with name collisions, it makes sense to expand the compile command so that it can also take into account suffixes. i.e. meson compile -C build foo.exe can now work if the executable has an exe suffix along with being named foo.
2023-08-30Merge pull request #10332 from xclaesse/std-optJussi Pakkanen1-1/+1
c_std, cpp_std: Change to a list of desired versions in preference order
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz1-4/+4
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/ ```
2023-08-11remove useless type annotationsEli Schwartz1-1/+1
These annotations all had a default initializer of the correct type, or a parent class annotation.
2023-08-06UserArrayOption: Make listify_value() a static methodXavier Claessens1-1/+1
2023-08-06UserArrayOption: Remove user_input argumentXavier Claessens1-1/+1
The only place it can be set to False is from optinterpreter. Better check value there and deprecate string usage.
2023-05-05mcompile: Fix target name suggestionsXavier Claessens1-1/+1
2023-03-29Make --vsenv a readonly builtin optionXavier Claessens1-2/+2
We need to remember its value when reconfiguring, but the Build object is not reused, only coredata is. This also makes CLI more consistent by allowing `-Dvsenv=true` syntax. Fixes: #11309
2023-03-17fix meson compile with alias targetCharles Brunet1-3/+4
this fixes a bug introduced by #11528
2023-03-16coredata: Do not pickle it twiceXavier Claessens1-2/+1
Exclude coredata from build.dat because it gets pickled separately already.
2023-02-24mcompile: Do not exclude targets from subprojectsXavier Claessens1-5/+3
When giving full path to a target there is no reason to skip targets from subprojects, the path can start with `subprojects/`.
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2022-11-29pylint: enable the bad_builtin checkerDylan Baker1-5/+3
This finds uses of deny-listed functions, which defaults to map and filter. These functions should be replaced by comprehensions in idiomatic python because: 1. comprehensions are more heavily optimized and are often faster 2. They avoid the need for lambdas in some cases, which make them faster 3. you can do the equivalent in one statement rather than two, which is faster 4. They're easier to read 5. if you need a concrete instance (ie, a list) then you don't have to convert the iterator to a list afterwards
2022-09-12mcompile: Remove useless sleepXavier Claessens1-2/+0
There is no reason to wait 2s before starting the compilation command. Fixes: #10698.
2022-08-26Remove redundant backslash and fix white space issueAlf Henrik Sauge1-1/+1
2022-08-12mcompile: provide user visibility into what actually happensEli Schwartz1-2/+8
This command is magical and I hate it. Mostly because it seems people have no clue what it does, and what it doesn't do. Provide informational messages to the user indicating how it works, e.g. for debugging. Point out if we ran vsenv before shelling out to the backend.
2022-05-01mcompile: Print suggestions when target is ambigousXavier Claessens1-1/+8
Fixes: #10221
2022-01-26mcompile: fix broken codepaths and restore orphaned codeEli Schwartz1-7/+5
In commit 928078982c8643bffd95a8da06a1b4494fe87e2b a good error message about the directory not being a valid build directory, was replaced by a worse message. In commit abaa980436f53100041bd5535589bb1c42019bd6 the error message was replaced by a traceback when trying to load the coredata before checking if it was a build directory. Revert back to using the helper function with the good error message. Reorganize code so that we check basic things first, and do less work before detecting errors. Fixes #9584
2021-10-30delete PLATFORM env only if setavitex1-2/+3
fixes #8721
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-3/+3
2021-10-25mcompile: Load coredata first because it checks major versionXavier Claessens1-9/+3
Fixes: #9444
2021-10-10Add --vsenv command line option and active VS only when neededXavier Claessens1-11/+11
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-08-29mcompile: treat load-average as a floatMike Gilbert1-1/+1
`ninja -l` accepts a double. We should do the same. Bug: https://bugs.gentoo.org/810655
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz1-2/+2
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-7/+7
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04raw string literals are next to godlinessEli Schwartz1-1/+1
Invalid escape sequences are deprecated and will be removed from a future version of python. Use r"" to define them so they remain readable.
2021-02-23mcompile: do not pass the builddir to ninja if it is the current directoryEli Schwartz1-1/+3
Because when you don't specify -C, this logging feels silly: ninja: Entering directory `.
2021-02-23mcompile: make sure arguments are passed in the correct orderEli Schwartz1-7/+8
meson compile itself doesn't permit GNU-style argument permutation, i.e. TARGET to precede options, so why should we expect ninja to? And indeed, ninja doesn't document support for this -- but it does accept it anyway, which is confusing and results in people thinking it's "supposed to" work. However, if NINJA=samu then this is in fact enforced. samu does not permit GNU-style argument permutation. As a result, the arguments passed to mcompile are actively re-ordered before being passed to the subprocess, and samu dies with a fatal error. Fix ordering in mcompile.py and add a comment to warn future readers that the order does, in fact, matter.
2021-01-13Fix misspellsAntonin Décimo1-1/+1
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-1/+1
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2020-12-07Remove "Found runner: " logging message from meson compileDaan De Meyer1-1/+0
The ninja path is already logged as part of configure. Logging it again every time when using meson compile is overly verbose and doesn't add much value for the user.
2020-11-20use real pathlib moduleDylan Baker1-1/+1
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-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-1/+1
2020-10-02Fix meson compile for 32-bit MSVC buildVili Väinölä1-12/+16
- Remove platform from env so that msbuild does not try to compile e.g. configuration debug|x86
2020-09-13mcompile: Add some basic XCode supportNirbheek Chauhan1-1/+47
I wrote this to convert run_tests.get_backend_commands() over to the new meson wrappers, but that turned out to be harder than I expected, so just splitting this out for now.
2020-09-08typing: fixup of #7688Daniel Mensinger1-1/+1
This bug not beeing caught in review is another reason for adding strict typing support to meson.
2020-09-08typing: more fixesDaniel Mensinger1-2/+4
2020-09-08typing: fully annotate mcompile, minit, and msetupDaniel Mensinger1-6/+6
2020-09-04environment: use ExternalProgram to find ninjaPaolo Bonzini1-1/+1
This allows the NINJA environment variable to support all the Windows special cases, especially allowing an absolute path without extension. Based on a patch by Yonggang Luo. Fixes: #7659 Suggested-by: Nirbheek Chauhan <nirbheek@centricular.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-31mcompile: Also support -v for verboseNirbheek Chauhan1-1/+1
This matches `meson test`, and there's really no other meaning that could be attributed to this, since you would call `meson` to get the version, not the `compile` sub-command.
2020-08-30mcompile: use -v instead of --verbose for ninjaIgor Raits1-1/+1
The `--verbose` has been added to ninja in 1.9.0 and we pretend that we have compatibility with Ninja 1.7+. References: https://github.com/ninja-build/ninja/commit/bf7517505ad1def03e13bec2b4131399331bc5c4
2020-06-29Added ability to specify target in `meson compile`TheQwertiest1-30/+179
2020-06-28Added ability to pass arguments to backend in `meson compile`TheQwertiest1-10/+25
2020-06-21mcompile: Add --verbose modeIgor Raits1-1/+10
Closes: https://github.com/mesonbuild/meson/issues/7352 Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>