Commit Graph

2524 Commits

Author SHA1 Message Date
Fini Jastrow 49cde9653c ninjabackend: Correct RPATH order
[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-20 19:00:25 +00:00
Dylan Baker bff0b41525 rust: Accept generated sources for main.rs
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-19 10:14:10 -08:00
Jussi Pakkanen 4b3d48a8c9
Merge pull request #8192 from dcbaker/submit/minstall-type-annotations
Add type annotations to minstall (and some related cleanups)
2021-01-14 15:17:49 +00:00
Dylan Baker e36aca42d0 build/interpreter: Split InstallDir to fix layering violation
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-13 13:32:48 -08:00
Antonin Décimo 39ede12aa5 Fix misspells
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13 12:53:10 -05:00
Luke Elliott 9efcdba0d5 Allow '//' as project function id due to git bash path conversion.
See https://stackoverflow.com/questions/54258996/git-bash-string-parameter-with-at-start-is-being-expanded-to-a-file-path
2021-01-12 17:42:57 +00:00
Xavier Claessens c659be6928 Interpreter: Fix nested subsubproject detection
A sub-subproject can be configured directly from
`subprojects/foo/subprojects/bar/` in the case `bar` is in the same git
repository as `foo` and not downloaded separately into the main
project's `subprojects/`. In that case the nested subproject violation
code was wrong because it is allowed to have more than one "subprojects"
in path (was not possible before Meson 0.56.0).

Example:
- self.environment.source_dir = '/home/user/myproject'
- self.root_subdir = 'subprojects/foo/subprojects/bar'
- project_root = '/home/user/myproject/subprojects/foo/subprojects/bar'
- norm = '/home/user/myproject/subprojects/foo/subprojects/bar/file.c'

We want `norm` path to have `project_root` in its parents and not have
`project_root / 'subprojects'` in its parents. In that case we are sure
`file.c` is within `bar` subproject.
2021-01-12 15:51:28 +00:00
Daniel Mensinger 8f1d9bb7b0 cmake: add PATH logic to preliminary dep check (fixes #8133) 2021-01-10 21:48:23 +00:00
Dylan Baker 3d80a88bd3 modules: Add an unstable-rust module
Like other language specific modules this module is module for holding
rust specific helpers. This commit adds a test() function, which
simplifies using rust's internal unittest mechanism.

Rust tests are generally placed in the same code files as they are
testing, in contrast to languages like C/C++ and python which generally
place the tests in separate translation units. For meson this is
somewhat problematic from a repetition point of view, as the only
changes are generally adding --test, and possibly some dependencies.

The rustmod.test() method provides a mechanism to remove the repatition:
it takes a rust target, copies it, and then addes the `--test` option,
then creates a Test() target with the `rust` protocol. You can pass
additional dependencies via the `dependencies` keyword. This all makes
for a nice, DRY, test definition.
2021-01-05 15:10:50 -08:00
Dylan Baker d89ec98b47 mtest: Add support for rust unit tests
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-05 10:23:41 -08:00
Michael Hirsch bad0e95cae unit:cpp17: make C++17 test stricter check
many compilers allowed "nodiscard" C++17 feature with pre-c++17 flags.
The C++17 filesystem typically actually does require -std=c++17.
This makes this unit test more representative of C++17 flag support.
2021-01-04 23:43:30 +00:00
Daniel Mensinger 6b515c4321 cmake: fix missing languages from CMake (fixes #8132) 2021-01-04 20:16:30 +00:00
Jussi Pakkanen ca30550e06 Handle uppercase dependency names in wraps. 2020-12-30 20:54:41 +00:00
Daniel Mensinger 5cbc8f866c cmake: fix -framework dependencies (fixes #8045) 2020-12-29 21:43:54 +00:00
Jussi Pakkanen 9f1ba40252
Merge pull request #8013 from mesonbuild/cppmodules
C++ module support
2020-12-14 15:00:04 +00:00
Oleg B b8052f9e50
Support native tests in crossbuild 2020-12-13 16:32:52 +02:00
Jussi Pakkanen 5bd1276d20 Create unit test for C++ modules and accept ixx as C++ source extension. 2020-12-11 19:21:02 +00:00
Jussi Pakkanen c21b04ba08 Add prelinking support for static libraries. 2020-12-03 22:58:07 +02:00
mimi89999 631a7b5a2a Add aarch64 assembly test 2020-11-29 23:50:23 +02:00
Paolo Bonzini 0deab2ee9e
compiler: allow non-built internal dependencies as arguments
Allow methods on the compiler object to receive internal dependencies,
as long as they only specify compiler/linker arguments or other
dependencies that satisfy the same requirements.

This is useful if you're using internal dependencies to add special
"-D" flags such as -DNCURSES_WIDECHAR, -D_XOPEN_SOURCE_EXTENDED or
-DGLIB_STATIC_COMPILATION.
2020-11-24 00:03:35 +02:00
Jason Ekstrand 15bbf1ea75 Handle cmake dependencies which require a specified version
Some CMake packages fail to find at all if no version is specified.
This commit adds a cmake_version parameter to dependency() to allow you
to specify the requested version.
2020-11-21 07:55:10 -08:00
Dylan Baker ea416591a9 cmVers: use env instead of hardcoding bash location 2020-11-21 07:55:10 -08:00
Jussi Pakkanen 913374834c
Merge pull request #7894 from obilaniu/cudaupdates
Update unstable CUDA Module to support newest toolkits and drivers.
2020-11-18 23:12:15 +02:00
Jussi Pakkanen c8af3c8d29 Revert "Add thinlto support. Closes #7493."
This reverts commit 3e6fbde94c.
2020-11-17 17:51:23 +02:00
Philip Withnall 42ba8efaf2 gnome: Drop use of volatile in GLib type functions
See https://gitlab.gnome.org/GNOME/glib/-/issues/600

`volatile` was previously mistakenly used in GLib to indicate that a
variable was accessed atomically or otherwise multi-threaded. It’s not
meant for that, and up to date compilers (like gcc-11) will rightly warn
about it.

Drop the `volatile` qualifiers.

Based on a patch by Jeff Law.

See also http://isvolatileusefulwiththreads.in/c/.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 17:45:25 +02:00
Jussi Pakkanen 299a67781e
Merge pull request #7843 from dcbaker/submit/rustc-fixes
A few fixups for rust
2020-11-14 13:47:39 +02:00
jpark37 a441b13b89 Use c99 instead of c11 for buildoptions test
Older verisons of MSVC do not support C11 properly.
2020-11-13 16:13:02 -08:00
Dylan Baker 5c74cccbb9 run_unittests: use textwrap.dedent
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-11-13 09:00:35 -08:00
Sam Thursfield 21897a10ca gnome: Handle libraries that are not in the current build dir
The generate_gir() function previously assumed all library
inputs were in the current build dir. This would fail if they
weren't.
2020-11-13 17:39:47 +02:00
Jones 8351e85bbd
interpreter: Add get_keys function for configuration_data (#7887) 2020-11-12 20:43:17 +02:00
Jussi Pakkanen 41a79a0757
Merge pull request #7965 from dcbaker/wip/2020-11/macos-github-actions
Migrate osx CI from travis to github actions
2020-11-12 20:36:27 +02:00
Haelwenn (lanodan) Monnier d2aac3d809 dependencies: Put pkgconfig options before operands
This fixes building with meson when the POSIX behavior of getopt is used, such as when GNU libc is used with POSIXLY_CORRECT=1 defined
2020-11-12 20:27:40 +02:00
Dylan Baker 91bf84eaa5 tests/rust: dynamic linking doesn't work on darwin
This is a bug, and needs to be fixed, but in the short term testing
other rust functionality on darwin is an improvement over testing none.
2020-11-11 07:42:40 -08:00
Dylan Baker 40258cd29e tests/frameeworks 8/flex: fix undefined functions
Some compilers don't have explicit errors for undefined functions
enabled by default. Apple clang seems to.
2020-11-11 07:42:40 -08:00
Dylan Baker 1a494ccfbe tests/28 multiline string: include required headers
we're relying on printf being defined with stdio.h, which happens to
work sometimes. It doesn't work with Apple clang though.
2020-11-10 15:38:43 -08:00
Jussi Pakkanen 3e6fbde94c Add thinlto support. Closes #7493. 2020-11-08 16:00:05 +02:00
Olexa Bilaniuk 3f6977c866 Update CUDA module's nvcc_arch_flags() and nvcc_arch_readable() for new
CUDA Toolkits.

Also harden internal logic and add several asserts in the testcase.
2020-11-05 14:50:22 -05:00
Olexa Bilaniuk cfd31e38a8 Add newer CUDA Toolkit version entries.
Also, remove the possibility of passing in a compiler instance to
min_driver_version. This is because the NVCC compiler instance is,
as of CUDA Toolkit 11.0, no longer guaranteed to be versioned
identically to the toolkit itself.
2020-11-05 14:50:22 -05:00
Michael Weiss cc033e5476
docs: Recommend to use SPDX license identifiers [skip ci]
Some license identifiers are ambiguous (e.g. "GPL3"). The SPDX license
identifiers avoid this by providing standardized and unique identifiers
(e.g. "GPL-3.0-only" or "GPL-3.0-or-later" for the previous example).

Because SPDX short-form identifiers are also both human- and
machine-readable we should recommend them in the documentation.

More information (advantages, details, etc.) can be found here:
- https://spdx.dev/resources/use/#identifiers
- https://spdx.dev/ids/

Fix #7905.
2020-11-05 21:28:12 +02:00
Dylan Baker 7860a6aeab rust: implement support for --edition
Using the std option, so now `rust_std=..` will work. I've chosen to use
"std" even though rust calls these "editions", as meson refers to
language versions as "standards", which makes meson feel more uniform,
and be less surprising.

Fixes: #5100
2020-11-05 21:24:20 +02:00
Jussi Pakkanen 9d1e747d17 Condense test directory names again. 2020-11-03 21:05:20 +02:00
Dylan Baker 47d071a34f interpreter: store correct files for project regeneration
Right now sub-sub projects are not correctly registered, because we
don't have a way to pass up past the first level of subproject. This
patch changes that by making the build_Def_files as defined in the
Interpreter initializer accurate for translated dependencies, ie, cmake
dependencies won't define a dependency on a non-existent meson.build.
This means that it can always add the subi.build_def_files because they
are always accurate.
2020-11-01 19:26:31 +02:00
Daniel Mensinger fc57089bc5 cmake: Disable the new (CMake 3.16) PCH support
Subprojects that use the CMake PCH feature will cause
compilation/linker errors. The CMake PCH support
should thus be disabled until this can be properly
translated to meson.
2020-10-24 19:31:15 +02:00
Dylan Baker e8399c8c6e
depenencies/llvm: Handle llvm-config --shared-mode failing (#7379)
* depenencies/llvm: Handle llvm-config --shared-mode failing

Fixes: #7371
Fixes: #7878

* test cases/llvm: Refactor to use test.json

Instead of trying to cover everything internally
2020-10-22 17:21:14 +03:00
Jussi Pakkanen 64f8479097 In text, betterer grammer usings. 2020-10-19 00:04:14 +03:00
Xavier Claessens a050db5e30 Fix gnome.compile_resources() when glib is a subproject
When glib is a subproject we should use glib-compile-resources it
overrides using find_program() in the case it is not installed on the
build machine. With old glib version we have to run
glib-compile-resources at configure time to generate the list of
dependencies, but not when glib is recent enough.
2020-10-17 22:25:57 +03:00
Xavier Claessens 254b836bd4 Add test case for "subproject:opt" in project()
This is regression test for #7573
2020-10-16 17:42:24 -04:00
Carlos Bederian 71be873be2 Add CUDA compiler header symbol tests 2020-10-16 18:18:46 +02:00
Xavier Claessens bcf369ea3c Fix consistency in variables kwarg
Share common code to extract the `variables` kwarg in
declare_dependency() and pkg.generate().
2020-10-16 18:09:56 +03:00
Daniel Mensinger 7c377e5a5d intro: Add extra_files key to intro output (fixes #7310) 2020-10-15 01:56:59 +03:00