aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
AgeCommit message (Collapse)AuthorFilesLines
2021-05-19backends: use a set for processed targets instead of a dictDylan Baker1-1/+1
We're only interested in the keys, not in the value (which was always set to True), so a set is a better data structure anyway.
2021-04-26introspection: export all sources for custom targetsJason Francis1-0/+2
Also adds some test cases for source files in target_sources.
2021-04-25Xcode: make Swift projects work.Jussi Pakkanen1-0/+6
2021-04-21Xcode: put all include dirs via a property rather than a cmd line arg.Jussi Pakkanen1-2/+6
2021-04-19Xcode: regenerato project file when build conf changes.Jussi Pakkanen1-0/+16
2021-04-18Xcode: fix running commands that lie in the build root dir.Jussi Pakkanen1-1/+1
2021-04-18Xcode: fix custom target chaining.Jussi Pakkanen1-2/+2
2021-04-16Xcode: fix custom targets that produce objs and libs.Jussi Pakkanen1-0/+24
2021-04-11Xcode: fix setting up inlude args for source and build dirs.Jussi Pakkanen1-2/+6
2021-04-10Xcode: Fix source generation.Jussi Pakkanen1-1/+13
2021-04-09Write include dirs with absolute paths in the Xcode backend, relative ones ↵Jussi Pakkanen1-4/+7
do not seem to work.
2021-03-26backends: Remove @PRIVATE_OUTDIR_(ABS)@ substitutionXavier Claessens1-12/+0
It is not documented and does not seems to be used anywhere.
2021-03-23devenv: Set GI_TYPELIB_PATH and LD_LIBRARY_PATH (#8548)Xavier Claessens1-3/+18
2021-03-19split program related classes and functions out of dependenciesDylan Baker1-7/+8
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens1-0/+19
2021-03-16EnvironmentVariables: Simplify and annotateXavier Claessens1-4/+4
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-13/+13
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz1-1/+1
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-03-03Windows Subsystem for Linux can run .exe without mono interpreterXavier Claessens1-1/+1
Fixes: #8445
2021-02-27install_man locale supportJason Woodward1-2/+8
Rather than having to manually build the locale aware man paths with `install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')` Support doing `install_man('foo.fr.1', locale: 'fr')`
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens1-33/+34
By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
2021-02-18Don't access other enum members from selfMiro Hrončok1-3/+4
This is deprecated in Python 3.10. Instead, acces them from the class. Fixes https://github.com/mesonbuild/meson/issues/8318
2021-02-17Substitute @CURRENT_SOURCE_DIR@ in run_target() and custom_target()Xavier Claessens1-0/+2
run_target() does some variable substitutions since 0.57.0. This is a new behavior, and undocumented, caused by sharing more code with custom_target(). More consistency is better, so document it now. custom_target() was doing variable substitution in the past, because it shared some code with generator(), but that was undocumented. Some refactoring in 0.57.0 caused it to not replace @CURRENT_SOURCE_DIR@, @SOURCE_DIR@, and @BUILD_DIR@ anymore. This patch adds back @CURRENT_SOURCE_DIR@ and document it. It does not add back @SOURCE_DIR@ because it is duplicate with @SOURCE_ROOT@ that has a better name. Also do not add back @BUILD_DIR@ which is duplicate of @PRIVATE_DIR@, and not @BUILD_ROOT@ surprisingly, adding to the confusion.
2021-02-09backends: Fix custom_target() with configure_file() exeXavier Claessens1-0/+3
2021-02-09backends: Always use the command returned by as_meson_exe_cmdline()Xavier Claessens1-4/+4
Even if the command is not wrapped by meson, it could have been modified to add java/mono interpreters. This fix potential inconsistency between wrapped and unwrapped commands.
2021-02-08Fix exe wrapper detection for run targets.Jussi Pakkanen1-1/+11
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen1-23/+22
run_target: Add env kwarg
2021-02-05vala: Disable unity buildsDylan Baker1-1/+1
Our approach to unity builds with vala is broken, you cannot unify the generated C files, as they contain duplicate symbols. We would need to instead combine the files while they are still in their vala form, then convert that to C and compile the unified C file. This does not fix the linked issue, as this removed the ability to do vala unity builds, but it does allow running vala with `--unity=on`. Related: #5280
2021-02-05ninjabackend: Remove useless call to replace_paths()Xavier Claessens1-4/+4
Replacements are already done by eval_custom_target_command() and must be done BEFORE calling as_meson_exe_cmdline() anyway. replace_paths() is still used by generators. Make eval_custom_target_command() more readable by handling error in the final else case instead of in the middle of elif.
2021-02-05backend: Do not check for exe wrapper twiceXavier Claessens1-15/+2
It is already checked by as_meson_exe_cmdline().
2021-02-05run_target: Add env kwargXavier Claessens1-4/+16
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-02-04xcode-backend: add implicit includesJeff Moguillansky1-0/+11
Move helper functions get_source_dir_include_args and get_build_dir_include_args to backend base class
2021-01-30add_install_script: add skip_if_destdir kwargXavier Claessens1-0/+1
It is common, at least in GNOME projects, to have scripts that must be run only in the final destination, to update system icon cache, etc. Skipping them from Meson ensures we can properly log that they have not been run instead of relying on such scripts to to it (they don't always).
2021-01-30Fix executable as script on WindowsXavier Claessens1-31/+38
On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
2021-01-27custom_target: Add env kwargXavier Claessens1-5/+8
2021-01-21Unity build reverts to normal for fortran fixJonas Lundholm Bertelsen1-0/+8
The `determine_ext_objs` function did not take into account that fortran (and d) does not support unity builds. This caused failures in some cases.
2021-01-20When iterating link_targets, include link_whole_targets too (fortran)Jonas Lundholm Bertelsen1-1/+2
This fixes fortran includes and fortran orderdeps for libraries that were under link_whole_targets.
2021-01-17Removal of /ZI on MSVC DebugMarios Staikopoulos1-4/+5
The /ZI flag adds in "Edit and Continue" debug information, which will cause massive slowdown. It is not a flag that we should be adding by default to debug builds. /Zi will still be added.
2021-01-13backends/backends: Add type annotations for InstallDataDylan Baker1-27/+36
This adds enough type annotations for InstallData and friends to make minstall happy. There is also a small change in that I've replaced the List[List] with List[Tuple], as tuples are more appropraite data types for the information (fixed length, position matters, different types at different indexes)
2021-01-11use PEP8 style naming for LANGUAGES_USING_* as wellDylan Baker1-2/+2
2021-01-05mtest: Add support for rust unit testsDylan Baker1-0/+5
Rust has it's own built in unit test format, which is invoked by compiling a rust executable with the `--test` flag to rustc. The tests are then run by simply invoking that binary. They output a custom test format, which this patch adds parsing support for. This means that we can report each subtest in the junit we generate correctly, which should be helpful for orchestration systems like gitlab and jenkins which can parse junit XML.
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-8/+8
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).
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-14/+15
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04use OptionKey for compiler_optionsDylan Baker1-8/+7
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-18build: use PIE objects for static libraries if b_staticpic=false but b_pie=truePaolo Bonzini1-1/+1
If static_library is used as a convenience library (e.g. for link_whole) it should in principle not need position independent code. However, if the executables that the libraries is linked to are PIE, the non-PIC objects in the static library will cause linker errors. To avoid this, obey b_pie for static libraries if either b_staticpic=false or they use "pic: false". Without this patch, QEMU cannot use b_staticpic, which causes a slowdown on some QEMU benchmarks up to 20%.
2020-10-15intro: Add extra_files key to intro output (fixes #7310)Daniel Mensinger1-1/+1
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-2/+2
2020-09-29Merge pull request #7762 from jon-turney/meson-exe-output-improveJussi Pakkanen1-6/+25
Improve the output for meson wrapped commands
2020-09-29compilers/VS: fix build to use optimization and debug flagsVili Väinölä1-0/+4
- Fixed using debug and optimization built-in options in MSVC. - Fixed that VS backend does not create pdb files in release mode. VS implicitly adds the debug fields if left out. - Fix that it is possible to add debug info with ninja backend with optimizations.