aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
AgeCommit message (Collapse)AuthorFilesLines
2021-02-07Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen1-2/+10
Add a wrapper to the rust module for bindgen
2021-02-07Merge pull request #8288 from bonzini/test-setup-exclude-suitesJussi Pakkanen1-3/+4
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-06build: Add type annotations for CustomTarget constructorDylan Baker1-2/+3
which are needed in the rust module for bindgen support.
2021-02-06Add a method to IncludeDirs to convert to string listDylan Baker1-0/+7
I'm going to use this in the rust module as well, so having a single source of truth is useful.
2021-02-05run_target: Add env kwargXavier Claessens1-35/+37
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-02interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini1-1/+3
This new keyword argument makes it possible to run specific test setups only on a subset of the tests. For example, to mark some tests as slow and avoid running them by default: add_test_setup('quick', exclude_suites: ['slow'], is_default: true) add_test_setup('slow') It will then be possible to run the slow tests with either `meson test --setup slow` or `meson test --suite slow`.
2021-02-02build: fix flake8Paolo Bonzini1-2/+1
2021-01-30build: add function get_build_targets to Build classJeff Moguillansky1-0/+7
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-8/+0
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-0/+2
2021-01-19rust: Accept generated sources for main.rsDylan Baker1-7/+16
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-3/+3
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-13build/interpreter: Split InstallDir to fix layering violationDylan Baker1-1/+16
Currently InstallDir is part of the interpreter, and is an Interpreter object, which is then put in the Build object. This is a layering violation, the interperter should have a Holder for build data. This patch fixes that.
2021-01-13build: Add some type annotationsDylan Baker1-12/+18
2021-01-13build/interperter: Add annotations and move input validation to interpreterDylan Baker1-7/+3
This moves the user input validation to the interpreter, instead of being in the build module, and adds type annotations.
2021-01-04fix LGTM warningsDylan Baker1-2/+2
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-7/+7
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-17/+18
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 Baker1-2/+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 Baker1-5/+7
2020-12-16build/interpreter: Add some type annotationsDylan Baker1-8/+10
2020-12-16build: Use python 3.6 annotation syntax for Build initializerDylan Baker1-10/+10
2020-12-16build: Add annotation for Build.dataDylan Baker1-1/+1
2020-12-16build/interpreter: fix layering violations for ManPagesDylan Baker1-1/+19
Like `install_headers`, `install_man` used the same objects for both the interpreter and the build, this is bad. Let's have two separate objects.
2020-12-16build/interpreter: split representation of HeadersDylan Baker1-1/+30
This was all layering violations before. Now we have Headers in the build module, and a holder in the interpreter. All of the type validation is done in interpreter method for `install_headers`.
2020-12-03Add prelinking support for static libraries.Jussi Pakkanen1-1/+21
2020-11-13run_unittests: use textwrap.dedentDylan Baker1-4/+5
So that editors that can fold code (vim, vscode, etc) can correctly fold functions, instead of getting confused by code that doesn't follow the current indention. Also, it makes the code easier to read.
2020-10-19switch gui_app deprecation to FeatureDeprecatedKwargsPaolo Bonzini1-1/+0
The deprecation message for "gui_app" is appearing for every target rather than just once, and even if the required version is older than 0.56.0. Use @FeatureDeprecatedKwargs to fix both issues.
2020-10-18build: use PIE objects for static libraries if b_staticpic=false but b_pie=truePaolo Bonzini1-7/+11
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-3/+2
2020-10-10Properly handle the case of linking static library with custom targetsSahnvour1-4/+31
2020-10-07Add win_subsystem kwarg. Closes #7765.Jussi Pakkanen1-3/+20
2020-09-22pylint: turn on bad-indentation errorDylan Baker1-4/+4
and fix all of the bad indentation
2020-09-18pylint: Catch cases of `if len(container)` which should be replaced by `if ↵Dylan Baker1-1/+1
container` Unfortunately this doesn't catch other abuses of len(continauer) like, `len(container) <comparator> 0`, see: https://github.com/PyCQA/pylint/issues/3751
2020-09-17Fixed MacOS dylib custom targets not marked as linkableMarco Mastropaolo1-1/+1
2020-09-08typing: Fix code reviewDaniel Mensinger1-4/+4
2020-09-08typing: fix code reviewDaniel Mensinger1-4/+4
2020-09-08typing: more fixesDaniel Mensinger1-21/+30
2020-08-18build: optimize extract_objectsPaolo Bonzini1-1/+2
extract_objects is repeatedly looking up files in self.sources, which is a list. Convert it to a set beforehand so that the lookup is O(1). On a QEMU build, the time spent in extract_objects goes from 3.292s to 0.431s. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-07-30pkgconfig: Fix various corner casesXavier Claessens1-10/+3
See unit tests for the exact scenarios this PR fixes.
2020-07-20Do not add rpaths for static libs. Closes #5191.Jussi Pakkanen1-1/+2
2020-05-22Merge pull request #7123 from dcbaker/use-feature-deprecatedJussi Pakkanen1-3/+2
Use FeatureDeprecated (and other cleanups)
2020-05-18Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen1-0/+2
Let .pc files and LDFLAGS provide rpaths.
2020-05-16Let .pc files specify rpath.Dan Kegel1-0/+2
Fixes #4027
2020-05-14use FeatureNew.single_useDylan Baker1-2/+2
This is just slightly cleaner looking
2020-05-14interpreter: Replace some uses of mlog.deprecation with FeatureDeprecatedDylan Baker1-1/+0
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.
2020-05-13Merge pull request #6620 from jon-turney/test-output-checkDylan Baker1-1/+4
Add a mechanism for validating meson output in tests
2020-05-13interpretor: Do not add dependencies if we already have themMarcel Hollerbach1-0/+4
in tree like dep structures with a lot of source: declarations, this can result in a lot of presure on the source list. this saves ~3s out of 7s in the interpretor stage in efl build.
2020-05-08Allow indexed custom target to be used in executable's depends.Szabi Tolnai1-1/+1
Change-Id: I7f3e0e0dd9c413d7f6e3267de9664b89f2294e27
2020-05-06Merge pull request #7064 from dcbaker/gtest-protocolJussi Pakkanen1-3/+5
Add support for Gtest as a test protocol