summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
Commit message (Collapse)AuthorAgeFilesLines
* interpreter: Allow dependecy or subproject name in force_fallback_forXavier Claessens2020-06-161-3/+6
|
* interpreter: Avoid new feature warning when using old has_exe_wrapper()Xavier Claessens2020-06-161-1/+4
|
* interpreter: add support for --force-fallback-forMathieu Duponchelle2020-06-161-2/+9
| | | | | | | | | This new command line option allows specifying dependencies for which to force fallback. See the documentation for more information Fixes: #7218
* Fix python3 installed from the Windows StoreD Scott Phillips2020-06-101-1/+14
| | | | | | | When meson is currently being run with a python that seems to have been installed from the Windows Store, replace the general WindowsApps directory in search paths with dirname(sys.executable), and also handle failures with pathlib.resolve on WindowsApps exe files.
* Merge pull request #6818 from mensinda/localPatchJussi Pakkanen2020-05-271-1/+1
|\ | | | | Wrap: add local files support via *_filename
| * wrap: Add support for local files via only `*_filename`Daniel Mensinger2020-04-251-1/+1
| |
* | interpreter: Add always set default value for version and set it ASAPDylan Baker2020-05-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Ideally we wouldn't need to have the default dict here and could just rely on it being set as soon as project is called. There is a corner case exercised by test case common/35 run program, which is that if a FeatureNew or FeatureDeprecated is called to generate the meson version it will be unset, to work around this I've changed the type from a dict to a default dict with '' as the default value. A better fix would probably be to store all of the FeatureNew/FeatureDeprecated checks until the end, then evaluate them, but for now this results in no loss of functionality, only more functionality, even if it isn't prefect.
* | use FeatureNew.single_useDylan Baker2020-05-141-20/+23
| | | | | | | | This is just slightly cleaner looking
* | interpreter: Replace some uses of mlog.deprecation with FeatureDeprecatedDylan Baker2020-05-141-2/+5
| | | | | | | | | | | | This gives the version that the feature was deprecated in, and doesn't print the warning if the project supports versions of meson in which the project wasn't deprecated.
* | interpreter: Rename has_exe_wrapper -> can_run_host_binariesDylan Baker2020-05-141-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of this function has changed enough that the name doesn't really reflect what it actually does. It basically returns true unless you're cross compiling, need and exe_wrapper, and don't have one. The original function remains but is marked as deprecated. This makes one small change the meson source language, which is that it defines that can_run_host_binaries will return true in build == host compilation, which was the behavior that already existed. Previously this was undefined in build == host compilation.
* | Merge pull request #6620 from jon-turney/test-output-checkDylan Baker2020-05-131-9/+11
|\ \ | | | | | | Add a mechanism for validating meson output in tests
| * | Cosmetic tweak to error message for incdir() with an absolute pathJon Turney2020-04-301-2/+3
| | | | | | | | | | | | | | | | | | Cosmetic tweak to the error message for incdir() with an absolute path. Don't split the message in the middle of a sentence at a point which may or may not correspond to the terminal width.
| * | Check before compiler detection if 'c' language is present when adding 'vala'Jon Turney2020-04-301-5/+6
| | | | | | | | | | | | | | | | | | For the sake of a consistent error message (irrespective of if 'valac' is present or not), check if the 'c' language is present if we are adding 'vala' before (rather than after) we do compiler detection.
| * | Be more careful about the use of repr() in error messagesJon Turney2020-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally, we'd want to use str() rather than repr() in error messages anyhow, as that explicitly gives something designed to be read by humans. Sometimes {!r} is being used as a shortcut to avoid writing the quotes in '{!s}'. Unfortunately, these things aren't quite the same, as the repr of a string containing '\' (the path separator on Windows) will have those escaped. We don't have a good string representation to use for the arbitrary internal object used as an argument for install_data() when it's neither a string nor file (which doesn't lead to a good error message), so drop that for the moment.
* | | Merge pull request #7064 from dcbaker/gtest-protocolJussi Pakkanen2020-05-061-3/+6
|\ \ \ | | | | | | | | Add support for Gtest as a test protocol
| * | | Add native support for gtest testsDylan Baker2020-05-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gtest can output junit results with a command line switch. We can parse this to get more detailed results than the returncode, and put those in our own Junit output. We basically just throw away the top level 'testsuites' object, then fixup the names of the tests, and shove that into our junit.
| * | | Convert test protocol into an enumDylan Baker2020-04-301-1/+2
| |/ / | | | | | | | | | | | | This gives us better type safety, and will be important as we add more test methods
* | | Merge pull request #7060 from dcbaker/install-script-targetsJussi Pakkanen2020-05-031-14/+64
|\ \ \ | | | | | | | | Allow meson.add_*_script to take additional types
| * | | allow postconf and dist scripts to use Files, ExternalPrograms, andDylan Baker2020-04-301-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ConfigureFiles These things are all known to be ready when these scripts are run, and thus they can safely consume them.
| * | | interpreter: Allow install_script to use additional input typesDylan Baker2020-04-301-11/+59
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | This adds support for Files, CustomTarget, Indexs of CustomTargets, ConfigureFiles, ExternalPrograms, and Executables. Fixes: #1234 Fixes: #3552 Fixes: #6175
* | | Allow get_variable to still function when the fallback is a disabler.James Hilliard2020-04-301-0/+2
|/ /
* | Clarified error message for test(). (#7040)Benjamin Frye2020-04-281-1/+1
| | | | | | | | | | Changes the error message for test() so it now reports the expected and actual number of parameters. Fixes: #7029
* | gnome: Fix usage of gobject-introspection as subprojectXavier Claessens2020-04-281-0/+5
| |
* | dependency: log cached or skipped dependencies with reference to modulesEli Schwartz2020-04-281-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dependency: log cached or skipped dependencies with reference to modules If the dependency is a special dependency which takes modules, the modules get cached separately and probably reference different pkg-config files. It's very plausible that we have multiple dependencies, using different modules. For example: Run-time dependency qt5 (modules: Core) found: YES 5.14.2 (pkg-config) Dependency qt5 skipped: feature gui disabled Obviously this makes no sense, because of course we found qt5 and even used it. The second line is a lot more readable if it shows this: Dependency qt5 (modules: Widgets) skipped: feature gui disabled Similar confusion abounds in the case where a module is found in the cache -- which module, exactly, has been found here: Dependency qt5 found: YES 5.14.2 (cached) Rewrite the dependency function to *consistently* pass around (and use!) the display_name even in cases where we know it isn't anonymous (this is just more correct anyway), and make it serve a dual purpose by also appending the list of modules just like we do for pretty-printing that a dependency has just been found for the first time. * fixup! dependency: log cached or skipped dependencies with reference to modules pointlessly cast modules to str, as they cannot be anything else. But we want to fail later on, with something more friendly than a stacktrace. boost/wx have special exceptions for people passing an integer there.
* | find_program: Fixes when the program has been overridden by executableXavier Claessens2020-04-281-15/+37
|/ | | | | | | | | | | | | | - ExternalProgramHolder has path() method while CustomTargetHolder and BuildTargetHolder have full_path(). - The returned ExternalProgramHolder's path() method was broken, because build.Executable object has no get_path() method, it needs the backend. - find_program('overridden_prog', version : '>=1.0') was broken because it needs to execute the exe that is not yet built. Now assume the program has the (sub)project version. - If the version check fails, interpreter uses ExternalProgramHolder.get_name() for the error message but build.Executable does not implement get_name() method.
* Compiler options per langJohn Ericson2020-04-201-7/+7
| | | | | | | | | | | A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
* interpreter: Correctly ignore def files in build directoryXavier Claessens2020-04-171-7/+7
| | | | See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/85.
* interpreter: find_program: Store program's name when not foundAriel D'Alessandro2020-04-141-3/+3
| | | | | | | | | Currently, looking for a nonexisting program using find_program() will return an NonExistingExternalProgram instace with the default name 'nonexistingprogram'. Let's store the target program's name in it, so it can be printed if needed. Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
* interpreter: Show program's name on run_command error messageAriel D'Alessandro2020-04-141-1/+1
| | | | | | | Currently, the error message is printing the object itself. Showing the program's name is better. Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
* Fix requireed meson version for override_dependency()Xavier Claessens2020-04-081-1/+1
|
* quality / test: Fortran type hintingMichael Hirsch, Ph.D2020-04-051-9/+9
| | | | enhance fortran args tests
* interpreter: Fix Disabler support for modulesDaniel Mensinger2020-04-021-2/+2
|
* Fix legacy env var support with crossJohn Ericson2020-03-231-2/+1
| | | | Fix #3969
* Add property to disable compiler sanity checks during cross compilation.Jussi Pakkanen2020-03-221-1/+14
|
* Merge pull request #6636 from jon-turney/machine-detection-problemsJussi Pakkanen2020-03-201-0/+3
|\ | | | | Redetect machines when languages change
| * Redetect machines after every change to languagesJon Turney2020-02-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, detect_machine_info() is called: - from Environment.__init__(), before we have any compiler available - from Interpreter.__init__() with the list of languages provided to project() (determined via the initial parse_project()) This is not sufficent in the case where no languages are specified to project() and are later added with add_languages(). We cannot correctly detect that the host machine should be treated as x86 (on x86_64 hardware) until we have a compiler we are told to use. Redetect machines after project(), and after every add_languages().
* | cmake: Add find_package COMPONETS supportDaniel Mensinger2020-03-191-0/+2
| |
* | Merge pull request #6532 from jon-turney/languages-native-kwargJussi Pakkanen2020-03-091-6/+15
|\ \ | | | | | | Add add_languages(native:)
| * | Refine behaviour of add_languages() when native: is missingJon Turney2020-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the common case of a simple meson.build which doesn't contain any 'native: true' targets to not require a native compiler when cross-compiling, without needing any changes in the meson.build. v2: Do it the right way around!
| * | Add add_languages(native:)Jon Turney2020-02-091-6/+15
| | | | | | | | | | | | | | | | | | v2: Retain not using logical-and, to avoid short-circuiting side-effects of add_languages()
* | | Merge pull request #6736 from dcbaker/mesonlib-type-annotationsJussi Pakkanen2020-03-081-15/+13
|\ \ \ | | | | | | | | Mesonlib type annotations
| * | | Make use of unholderDylan Baker2020-03-051-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
| * | | mesonlib: Replace unholder argument to listifyDylan Baker2020-03-051-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | listify shouldn't be unholdering, it's a function to turn scalar values into lists, or flatten lists. Having a separate function is clearer, easier to understand, and can be run recursively if necessary.
* | | | dependency: Verify fallback variable consistencyXavier Claessens2020-03-061-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change made `5 dependency versions` unit test fail because now once a subproject has been configured, the fallback variable is checked to be consistent. So it has to use new subproject because 'somesub' was already configured by previous tests.
* | | | Improve logged messages for overriden dependenciesXavier Claessens2020-03-061-11/+17
| | | |
* | | | Allow override_dependency() with a not-found depXavier Claessens2020-03-061-0/+7
| | | |
* | | | Simplify dependency() fallbackXavier Claessens2020-03-061-13/+25
| | | | | | | | | | | | | | | | | | | | Now that subprojects can override the dependency name, there is no need to provide a variable name for the fallback any more.
* | | | Add meson.override_dependency()Xavier Claessens2020-03-061-17/+54
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to meson.override_find_program() but overrides the result of the dependency() function. Also ensure that dependency() always returns the same result when looking for the same dependency, this fixes cases where parts of the project could be using a system library and other parts use the library provided by a subproject.
* | | interpreter: add 'name' method to BuildTargetHolderStéphane Cerveau2020-03-041-0/+7
| | | | | | | | | | | | | | | | | | | | | As any child of BuildTargetHolder might need the name of the object, provides a method to get object name. This is useful in gst-build to display the plugin name and not the filename.
* | | review: Initial fixupDaniel Mensinger2020-03-021-5/+5
| | |