aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-06-20mconf: print global compiler optionsPaolo Bonzini1-2/+2
Fixes: #14476 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-20options: do not store duplicate UserOptionsPaolo Bonzini1-6/+6
These options are never looked up except by "meson configure" and introspection, because option values are taken from self.augments[] instead. Fixes: #14558 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: fix option orderingPaolo Bonzini4-25/+106
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18tests: skip test common/223 in the -Ddefault_library=... jobsPaolo Bonzini2-0/+6
It is impossible to detect the source of default_library=both from within the test, so add yet another knob... :( Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18interpreter: bump priority of default_library=static that comes from fallbackPaolo Bonzini2-6/+14
We're about to lower the priority of the default_options that were passed to subproject() and dependency() below that of machine files and command line options. Whenever a static dependency is falling back to a subproject, however, do not do that. It makes no sense to build a shared library in that case. Another possibility however could be to just make it an error. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18test cases: do not pass global option on command linePaolo Bonzini3-12/+6
The test covers overriding an option from the dependency() function. If the same option is passed on the command line, it overrides the dependency()'s default_options as well. Tweak the description of the unittests that uses the same sources. The tests pass, but I am not sure they should. For example in the second test the default_library=both setting in the machine file should have the same effect as the -D option (machine files have lower priority than command line, but higher priority than anything in meson.build files). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: all inputs to OptionStore are OptionKeysPaolo Bonzini3-48/+26
Thanks to several fixes applied between commit d37d649b0 ("Make all Meson level options overridable per subproject.", 2025-02-13) and now, OptionStore never gets a string key. Tighten the type of OptionDict, and use it whenever possible. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18coredata: use OptionKey for the keys of cmd_line_optionsPaolo Bonzini2-14/+15
The cmd_line_options dictionary is described as having OptionKey keys, so make sure that cmd_the keys do have the correct type. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: remove double assignmentPaolo Bonzini1-1/+0
self.project_options is set already a couple lines above. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: do not use always-true variablePaolo Bonzini1-3/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: reuse set_option_maybe_rootPaolo Bonzini2-41/+22
There is common logic hiding between project() and "meson configure": the complication that the comment mentions for the "default_options" case actually applies to "meson configure", to machine files, to command line options and to project options. Reuse the same function in all four cases. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: use nicer type annotation T.ContainerPaolo Bonzini1-1/+1
Suggested-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: accept backend options as pending on first invocationPaolo Bonzini2-1/+10
They must be there when running re-configuring, because the backend cannot be changed, but they can be pending on the first invocation. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18optiontests: use a real system optionPaolo Bonzini1-3/+3
Once unknown options will go through accept_as_pending_option, only system options that really exist in Meson will be accepted. Adjust the unit tests. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18options: print option name before "as_root()" in errorsPaolo Bonzini3-24/+28
Starting with Meson 1.8.0, "meson configure" prints some options as ":foo" instead of "foo". Print the option as it was passed by the user. While at it, make errors more consistent and/or correct (e.g. "Unknown option" instead of "Unknown options"). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18interpreter: fix incorrect _do_subproject* annotationPaolo Bonzini1-5/+6
Use the type that is produced by the converter, and fix the type for methods_map which has a wrongly-placed bracket. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18interpreter: use correct type for project_default_optionsPaolo Bonzini1-5/+2
The converter in DEFAULT_OPTIONS makes a mapping from OptionKey to Python values, so use the correct type. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18compilers: pgi: fix preprocessing argumentsPaolo Bonzini1-0/+6
Based on reports from the users, PGI compilers need an explicit "-o -" on the command line to emit preprocessed output on stdout. Override the methods in the PGICompiler mixin to add it when output goes to stdout but not when output goes elsewhere. Fixes: #13216 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-18Remove coverage measurement.Jussi Pakkanen14-211/+17
2025-06-18Update Windows version in CI.Jussi Pakkanen1-1/+1
Windows 2019 in GH Actions goes away on the 30th.
2025-06-17docs: Make RefMan create symbols for all the referencesCorentin Noël1-0/+35
This makes all the symbols searchable from the .devhelp file.
2025-06-17docs: use backticks for envvarsSam James1-3/+3
2025-06-17docs: fix formatting of pkg_config_libdir propertySam James1-1/+1
2025-06-17Test serialization: Simplify determination of Windows extra pathsLuca Bacci1-5/+1
Pointed out by Charles Brunet
2025-06-17Test serialization: Also look for depends when setting PATH on WindowsLuca Bacci1-0/+1
Fixes https://github.com/mesonbuild/meson/issues/4668
2025-06-17Test serialization: set LD_LIBRARY_PATH also on DarwinLuca Bacci1-1/+7
It's needed on Darwin for the same reason it's needed on generic UNIX. Darwin supports both LD_LIBRARY_PATH and DYLD_LIBRARY_PATH, but the two are not quite equivalent [1], so we set both. [1] https://github.com/ffi/ffi/blob/29ad900a/lib/ffi/dynamic_library.rb#L40
2025-06-17Add project to check that test target's args and depends are in pathLuca Bacci9-0/+114
2025-06-17interpreterbase: remove per-object method dispatchingPaolo Bonzini1-11/+0
Only support class-based dispatch, all objects have been converted.
2025-06-17modules: convert custom holders to InterpreterObject.methodPaolo Bonzini2-19/+13
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: convert remaining objects to InterpreterObject.methodPaolo Bonzini1-86/+70
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: convert compiler to InterpreterObject.methodPaolo Bonzini1-40/+38
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: convert mesonmain to InterpreterObject.methodPaolo Bonzini1-33/+32
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: make methods per-class for primitivesPaolo Bonzini6-67/+60
Do not call update() and Enum.__hash__ a gazillion times; operators are the same for every instance of the class. In order to access the class, just mark the methods using a decorator and build METHODS later using __init_subclass__. Non-primitive objects are not converted yet to keep the patch small. They are created a lot less than other objects, especially strings and booleans. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: make operators per-classPaolo Bonzini8-62/+57
Do not call update() and Enum.__hash__ a gazillion times; operators are the same for every instance of the class. In order to access the class for non-trivial operators, the operators are first marked using a decorator, and then OPERATORS is built via __init_subclass__. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: make trivial_operators per-classPaolo Bonzini6-63/+81
Do not call update() and Enum.__hash__ a gazillion times; trivial operators are the same for every instance of the class. Introduce the infrastructure to build the MRO-resolved operators (so the outcome same as if one called super().__init__) for each subclass of InterpreterObject. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: make operator functions binaryPaolo Bonzini8-53/+63
In preparation for moving them to the class, make the operator functions binary. Adjust the lambdas for trivial operators, and store unbound methods for non-trivial ones. Note that this requires adding operators manually for every override, even subclasses. It's decidedly ugly at this temporary stage; later it will result in just an extra @InterpreterObject.operator decorator on the subclasses. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-17interpreter: fix a couple FeatureNew messagesPaolo Bonzini1-2/+2
2025-06-16docs: Generate the devhelp file from the documentationCorentin Noël1-0/+2
Allows to browse the documentation offline.
2025-06-09AstInterpreter: Fix dead-code-crashVolker Weißmann8-10/+49
Without this commit, the rewriter and the static introspection tool crash if `meson.build` contains something like ```meson if false foo = not_defined endif ``` or ```meson if false message(not_defined) endif ``` While it could be argued, that you should not write stuff like this, this used to raise a `MesonBugException`, which we have to fix. Fixes #14667
2025-06-09modules/gnome: Allow to generate markdown and reStructuredText dbus docCorentin Noël4-3/+89
gdbus-docgen supports reStructuredText output since 2.71.1 and markdown since 2.75.2, allow to simply generate it.
2025-06-08add unittest for cmake preprocessingJan2001012-0/+51
it uses the existing 14 configure file test case to configure config 7 and 10 with cmake and meson and then compares the relevant output to see if they are equal
2025-06-08replace regex implementation for cmake with a parserJan2001013-65/+107
cmake does preprocessing in a linear pass through the entire file this allows recursive variable lookups which cannot be supported by a basic regex implementation.
2025-06-08handle empty curly braces correctlyJan2001011-1/+1
in cmake variables are pure strings with no minimal required length so an empty string is a valid key and ${} needs to be handled accordingly.
2025-06-08handle spacing between # and cmakedefineJan2001011-4/+5
just as with C defines cmakedefine supports a variable amount of whitespace between the # symbol and the actual token.
2025-06-06Fix Flang stdlib linking for LLVM toolchain versions >= 19Mugundanmcw1-1/+5
2025-06-05swift: Pass C base compile options to swiftcKatalin Rebhan5-1/+31
2025-06-05unittests: use UnitTest helper methods instead of raw assertDylan Baker1-4/+4
Which doesn't give helpful error messages unless used with pytest
2025-06-05vala: Pass --shared-library to valac when generating a .gir fileCorentin Noël1-0/+3
This is required to make sure that the generated .gir file actually contains all the information to be used dynamically. Valac supports this argument since 0.29.3 released in 2015.
2025-06-05build: Fix tasking compiler b_lto detection for overridesDylan Baker1-1/+7
Actually take an override into account, ie: ```meson library( ... override_options : {'b_lto' : false}, ) ```
2025-06-05backend: fix tasking compiler support after option refactorgerioldman1-3/+3