aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
AgeCommit message (Collapse)AuthorFilesLines
2021-03-09change RSP quote style decision logicRemi Thebault1-3/+12
Take into account LDC on Windows Fixes #8494
2021-03-06Fix Fortran dep scanner for upper case file extensions. Closes #8395.Jussi Pakkanen1-1/+1
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz4-89/+89
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-26rust: a meson -l argument could be etiher a static or dynamic libraryDylan Baker1-2/+2
I made an incorrect assumption that -l arguments would always be static libraries, but they might well be shared libraries.
2021-02-26Merge pull request #8404 from dcbaker/submit/rust-c-dependenciesJussi Pakkanen1-4/+18
Fix linking Rust with C dependencies
2021-02-25Allow custom target output to be processed by generatorsMatthias Klumpp1-9/+17
2021-02-23rust: replace for loop with any()Dylan Baker1-4/+1
This is a little cleaner, and short circuits correctly, unlike the loop it replaces
2021-02-23rust: fix linking with external dependenciesDylan Baker1-0/+17
Rust can link with any dependency that uses c linkage, which is pretty much what we assume across the board anyway.
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-19Fix combining C and Fortran. Closes #8377.Jussi Pakkanen1-2/+5
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-16Fix VS C++ module support.Jussi Pakkanen1-1/+2
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 Claessens2-15/+12
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 Pakkanen3-3/+13
2021-02-07Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen1-7/+12
Add a wrapper to the rust module for bindgen
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen3-108/+54
run_target: Add env kwarg
2021-02-06backends/ninja: Implement linking a C ABI target into a rust targetDylan Baker1-7/+12
2021-02-05vala: Disable unity buildsDylan Baker2-14/+13
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: add a few annotationsDylan Baker1-5/+7
2021-02-05ninjabackend: Remove useless call to replace_paths()Xavier Claessens2-5/+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 Claessens3-17/+4
It is already checked by as_meson_exe_cmdline().
2021-02-05run_target: Add env kwargXavier Claessens3-86/+46
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 Moguillansky3-14/+18
Move helper functions get_source_dir_include_args and get_build_dir_include_args to backend base class
2021-02-04xcode-backend: set global link argsJeff Moguillansky1-0/+3
2021-02-04xcode-backend: fix include pathsJeff Moguillansky1-1/+2
Add project directory as include path Add include paths from dependencies for all languages (c, c++, objc, objc++)
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-30build: add function get_build_targets to Build classJeff Moguillansky1-33/+33
Add function to Build class to get targets of type BuildTarget Update xcode backend to call get_build_targets when iterating over targets. This resolves crash in xcode backend when using custom targets: AttributeError: ‘CustomTarget’ object has no attribute ‘objects’
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-28xcode-backend: fix include pathsJeff Moguillansky1-0/+3
Add include paths from dependencies
2021-01-27custom_target: Add env kwargXavier Claessens3-7/+12
2021-01-25Merge pull request #8236 from ↵Jussi Pakkanen1-1/+1
dcbaker/submit/rust-fix-generated-sources-in-subdir Submit/rust fix generated sources in subdir
2021-01-25Add ARM64EC as a new conceptual cpu type of arm64Ben Niu1-1/+7
ARM64EC is a new ARM64 ABI made by Microsoft. The ARM64EC binaries can be loaded in x64 processes on the latest Windows Insider Preview on ARM64, and they don't need to be emulated for the sake of performance. To support the ARM64EC build target, a new conceptual arm64 cpu type 'arm64ec' is added. The cpu can be specified in cross files like below to generate msbuild solution/vcxproj files with platform set to ARM64EC. [target_machine] system = 'windows' cpu_family = 'aarch64' cpu = 'arm64ec' endian = 'little'
2021-01-23Merge pull request #8226 from jonaslb/fortranstaticJussi Pakkanen2-11/+18
Fixes for fortran: Include dirs for link_whole_targets and capital file suffix
2021-01-23split mesonlib into a packageDylan Baker2-3/+3
Currently mesonlib does some import tricks to figure out whether it needs to use windows or posix specific functions. This is a little hacky, but works fine. However, the way the typing stubs are implemented for the msvcrt and fnctl modules will cause mypy to fail on the other platform, since the functions are not implemented. To aleviate this (and for slightly cleaner design), I've split mesonlib into a pacakge with three modules. A universal module contains all of the platform agnositc code, a win32 module contains window specific code, a posix module contains the posix specific code, and a platform module contains no-op implementations. Then the package's __init__ file imports all of the universal functions and all of the functions from the approriate platform module, or the no-op versions as fallbacks. This makes mypy happy, and avoids `if`ing all over the code to switch between the platform specific code.
2021-01-21ninjabackend: Correctly reference custom_target outputs in subdirs with rustDylan Baker1-1/+1
This was missed in the last iteration of fixing things.
2021-01-21Unity build reverts to normal for fortran fixJonas Lundholm Bertelsen2-7/+10
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-20ninjabackend: Correct RPATH orderFini Jastrow1-19/+20
[why] If we build and test a library we need to make sure that we find the currently build library object first, before an older system installed one. This can be broken if the library in question is installed in a custom path, and another library we depend on also is installed there. [how] Just move the rpath to the current build artifacts to the front. Solves #8030. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2021-01-20When iterating link_targets, include link_whole_targets too (fortran)Jonas Lundholm Bertelsen2-2/+6
This fixes fortran includes and fortran orderdeps for libraries that were under link_whole_targets.
2021-01-20Use case-insensitive suffix check for fortranJonas Lundholm Bertelsen1-2/+2
In Fortran it is common to use capital F in the suffix (eg. '.F90') if the source file makes use of preprocessor statements. Such files should probably be treated like all other fortran files by meson. Case insensitivity for suffixes was already implemented several places in meson before this. So most likely, the few places changed here were oversights anyway.
2021-01-19backend/ninja: Add order dependencies for generated sources in rustDylan Baker1-2/+5
2021-01-19rust: Accept generated sources for main.rsDylan Baker1-1/+12
There are still caveats here. Rust/cargo handles generated sources by writing out all targets of a single repo into a single output directory, setting a path to that via a build-time environment variable, and then include those files via a set of functions and macros. Meson's build layout is naturally different, and ninja makes working with environment variables at compile time difficult. Fixes #8157
2021-01-19Replace NinjaBackend is_rust_target with build.uses_rustDylan Baker1-8/+1
we have two functions to do the exact same thing, and they're basically implemented the same way. Instead, let's just use the BuildTarget one, as it's more generally available.
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