aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
AgeCommit message (Collapse)AuthorFilesLines
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
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-04fix: llvm toolset is "ClangCL" in VS2019.Luke Elliott1-1/+1
2021-01-04Use a single coredata dictionary for optionsDylan Baker4-41/+40
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 Baker3-37/+39
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-04move OptionKey to mesonlibDylan Baker2-4/+2
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker3-19/+19
2021-01-04use OptionKey for backend_optionsDylan Baker2-4/+6
2021-01-04use OptionKey for coredata.user_optionsDylan Baker1-1/+1
2020-12-29Only do module scanning if C++ version is latest.Jussi Pakkanen1-0/+2
2020-12-28Fix network path output in ninja backend on WindowsSamuel Longchamps1-0/+7
2020-12-25Extend the C++ module scanner to handle Fortran, too.Jussi Pakkanen1-35/+48
2020-12-14Propagate Windows target checks upLaurin-Luis Lehning1-4/+6
2020-12-14Give get_gui_app_args access to the EnvironmentLaurin-Luis Lehning1-1/+2
2020-12-14Give get_win_subsystem_args access to envLaurin-Luis Lehning1-1/+1
2020-12-13Add mypy annotations.Jussi Pakkanen1-1/+1
2020-12-13Scan all C++ sources and ignore everything else.Jussi Pakkanen1-5/+33
2020-12-13C++ module compilation works for a simple project.Jussi Pakkanen1-5/+21
2020-12-12Generate dependency scanning hooks in the Ninja file.Jussi Pakkanen1-9/+45
2020-12-11Generate scanning rules for C++ modules.Jussi Pakkanen1-0/+24