Commit Graph

467 Commits

Author SHA1 Message Date
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Dylan Baker 4b1c1d83c8 machinefiles: Allow keys to be stored case insensitive
This is required to make the various keys in the [user options] section
work the same as they do in the meson_options.txt file, where we don't
have any rules about case sensitivity.

There is some risk here. Someone may be relying on this lower by default
behavior, and this could break their machine files.

Fixes #7731
2020-10-05 08:59:45 -04:00
Dylan Baker 20663564bd deprecated get_configtool_variable and get_pkgconfig_variable
The get_variable method is able to do everything they do and more,
making it generally more useful. Let's tell people to stop using the old
ones.
2020-10-01 12:35:42 -07:00
Dylan Baker 5aee8567b8 dependencies/curses: Add a system dependency
That calls find_library and has_header in conjunction to look for curses
implementations that are baked into the system without any other find
method.
2020-09-29 14:58:32 -07:00
Dylan Baker 7d11d7cf68 dependencies/curses: Add support for using the ncurses config tools
These are mostly duplicated with pkg-config, but maybe someone has one
but not another, and they're easy to turn on with the
ConfigToolDependency.
2020-09-29 14:58:32 -07:00
Dylan Baker 137c3124e2
Merge pull request #7758 from dcbaker/submit/hdf5-factory
dependencies/hdf5: Convert to a dependency_factory
2020-09-29 14:55:38 -07:00
Xavier Claessens 7176b74fd6 Add meson.project_build/source_root() methods 2020-09-28 11:22:38 -04:00
Dylan Baker 54329eeed7 dependencies/hdf5: Use the correct compilers for the machine
Instead of the default ones, this is especially important when cross
compiling or when using compilers that aren't compatible with the
default ones.
squash! dependencies/hdf5: Use the actual system compilers
2020-09-25 11:11:46 -07:00
Dylan Baker b7cb30e175 dependencies/hdf5: Convert to a dependency_factory
Instead of a mega dependency that does everything, use a dependency
factory for config-tool and pkg-config
2020-09-25 11:11:46 -07:00
Xavier Claessens 55ea461993 Deprecate meson.build_root() and meson.source_root()
Those function are common source of issue when used in a subproject because they
point to the parent project root which is rarely what is expected and is a
violation of subproject isolation.
2020-09-23 12:14:32 -04:00
Sebastian Meyer a24fde6fde
Add support for the CompCert C Compiler
* Add preliminary support for the CompCert C Compiler

The intention is to use this with the picolibc, so some GCC flags are
automatically filtered. Since CompCert uses GCC is for linking, those
GCC-linker flags which are used by picolibc, are automatically prefixed
with '-WUl', so that they're passed to GCC.

Squashed commit of the following:

commit 4e0ad66dca9de301d2e41e74aea4142afbd1da7d
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 14:20:39 2020 +0200

    remove '-fall' from default arguments, also filter -ftls-model=.*

commit 41afa3ccc62ae72824eb319cb8b34b7e6693cb67
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 14:13:55 2020 +0200

    use regex for filtering ccomp args

commit d68d242d0ad22f8bf53923ce849da9b86b696a75
Author: Sebastian Meyer <meyer@absint.com>
Date:   Mon Aug 31 13:54:36 2020 +0200

    filter some gcc arguments

commit 982a01756266bddbbd211c54e8dbfa2f43dec38f
Author: Sebastian Meyer <meyer@absint.com>
Date:   Fri Aug 28 15:03:14 2020 +0200

    fix ccomp meson configuration

commit dce0bea00b1caa094b1ed0c6c77cf6c12f0f58d9
Author: Sebastian Meyer <meyer@absint.com>
Date:   Thu Aug 27 13:02:19 2020 +0200

    add CompCert to meson (does not fully work, yet)

* remove unused import and s/cls/self/

fixes the two obvious LGTM warnings

* CompCert: Do not ignore unsupported GCC flags

Some are safe to ignore, however, as per
https://github.com/mesonbuild/meson/pull/7674, they should not be
ignored by meson itself. Instead the meson.build should take care to
select only those which are actually supported by the compiler.

* remove unused variable

* Only add arguments once.

* Apply suggestions from code review

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>

* Remove erroneous ' ' from '-o {}'.format()

As noticed by @dcbaker

* added release note snippet for compcert

* properly split parameters

As suggested by @dcbaker, these parameters should be properly split into multiple strings.

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>

* Update add_compcert_compiler.md

Added a sentence about the state of the implementation (experimental); use proper markdown

* properly separate arguments

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-09-15 21:51:21 +03:00
Xavier Claessens 67c0ec1640 InternalDependency: Add as_link_whole() method 2020-09-14 20:32:22 -04:00
Xavier Claessens 9d338200da external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other
build systems.

Closes: #4316
2020-09-13 13:54:47 -04:00
Xavier Claessens 14c1a6983d msubprojects: Allow comma separated list of types 2020-09-10 11:39:30 -04:00
Xavier Claessens 1101144d86 doc: Update new `meson subprojects` behaviors 2020-09-10 11:39:30 -04:00
Jon Turney 1480fdfa9a Add release note snippet 2020-09-10 07:20:41 +00:00
Paolo Bonzini fa5c2363eb introspect: add test dependencies info to test/benchmark JSON
Add the ids of any target that needs to be rebuilt before running the
tests as computed by the backend, to the introspection data for tests and benchmarks.
This also includes anything that appears on the test's command line.

Without this information, IDEs must update the entire build before running
any test.  They can now instead selectively build the test executable
itself and anything that is needed to run it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-04 14:45:20 +02:00
Nirbheek Chauhan bfb8d25deb docs: Add a snippet for python 3.5 deprecation [skip ci] 2020-09-02 16:29:39 +00:00
Jussi Pakkanen 3a25efc056
Merge pull request #7581 from peterh/aix
Add AIX support
2020-08-25 23:58:17 +03:00
Eli Schwartz 1de1cc22e2 qt module: add qresource support to compile_translations
A common pattern in Qt5 applications is to embed translations in the
executable using the qresource system. In this case, the list of
translation files is already available in the .qrc file and there's no
good reason to duplicate this info in meson.build.

Let compile_translations optionally take a qrc input, in which case it
will go straight to generating the relevant translations and
rcc-generated .cpp, and directly return the thing users actually care
about -- the .cpp for linking.
2020-08-25 23:46:45 +03:00
Jussi Pakkanen c42298e146
Merge pull request #7447 from scivision/nvc
Add support for NVidia HPC SDK compilers
2020-08-22 18:31:56 +03:00
Xavier Claessens 1c403e20e7 Interpreter: Fix c_stdlib usage
- Exceptions raised during subproject setup were ignored.
- Allow c_stdlib in native file, was already half supported.
- Eliminate usage of subproject variable name by overriding
  '<lang>_stdlib' dependency name.
2020-08-18 14:47:38 -04:00
Peter Harris 1b2708eb79 docs: add AIX preliminary support snippet 2020-08-17 21:21:33 -04:00
Dylan Baker bbba6a7f36 Allow setting built-in options from cross/native files
This is like the project options, but for meson builtin options.

The only real differences here have to do with the differences between
meson builtin options and project options. Some meson options can be set
on a per-machine basis (build.pkg_config_path vs pkg_config_path) others
can be set on a per-subproject basis, but should inherit the parent
setting.
2020-08-01 22:00:06 -07:00
Dylan Baker a6164ca5a8 Allow setting project options from cross or native files
This allows adding a `[project options]` section to a cross or native file
that contains the options defined for a project in it's meson_option.txt
file.
2020-07-30 19:34:37 -07:00
Xavier Claessens c016401f95 coredata: Make warning_level per subproject builtin option 2020-07-22 19:19:50 -04:00
Marc-André Lureau aa0d75deae Stabilize keyval module
We have experimented with the module for about a year in a qemu
branch (https://wiki.qemu.org/Features/Meson), and we would like to
start moving the build system to meson. For that, keyval should have
the stability guarantees.

Cc: Paolo Bonzini <pbonzini@redhat.com>
2020-07-19 17:53:32 +03:00
Michael Hirsch, Ph.D 0c5f3c7483
doc 2020-07-13 00:20:53 -04:00
Jussi Pakkanen d0c68dc115 Updated everything for release 0.55.0. 2020-07-12 17:25:51 +03:00
Xavier Claessens 1993fb602e doc: Improve documentation of [provide] section in wrap files
Explicitly document the behaviour of dependency('foo-1.0', required:
false).
2020-07-05 18:02:20 +03:00
Xavier Claessens f08eed37cb find_program: Fallback if a wrap file provide the program name
We don't need the legacy variable name system as for dependency()
fallbacks because meson.override_find_program() is largely used already,
so we can just rely on it.
2020-07-01 09:51:57 -04:00
Xavier Claessens 2a7f72885f wrap: Add 'provide' section 2020-07-01 09:51:44 -04:00
Xavier Claessens 56c9e95b04 Implicit dependency fallback when a subproject wrap or dir exists 2020-07-01 09:45:33 -04:00
Jussi Pakkanen 64f36613ef
Merge pull request #7231 from mensinda/cmOverride
cmake: Add more advanced subproject configuration options
2020-07-01 00:04:08 +03:00
Xavier Claessens 4a371c97f4 wrap: Apply patch even in VCS cases 2020-06-30 19:42:43 +03:00
Xavier Claessens 1c8731a100 envconfig: Add [constants] section in machine files
Machine files already supports `+` operator as an implementation detail,
since it's using eval(). Now make it an officially supported feature and
add a way to define constants that are used while evaluating an entry
value.
2020-06-29 20:16:21 +03:00
TheQwertiest 5696a5abba Added ability to specify target in `meson compile` 2020-06-29 19:54:38 +03:00
TheQwertiest 4d0233540f Added ability to pass arguments to backend in `meson compile` 2020-06-28 18:13:49 -04:00
Xavier Claessens e353b2e8d4 wrap: Add patch_directory support
Copy a tree instead of extracting an archive.

Closes: #7216
2020-06-21 23:39:12 +03:00
Cary Converse a198e5d191 coverage: llvm-cov support 2020-06-17 23:02:50 -04:00
Mathieu Duponchelle 20709af4d2 interpreter: add support for --force-fallback-for
This new command line option allows specifying dependencies for
which to force fallback.

See the documentation for more information

Fixes: #7218
2020-06-16 13:45:40 -04:00
Xavier Claessens 0b4cf5a844 gnome: Add fatal_warnings kwarg to generate_gir()
Fixes: #7130
2020-06-16 08:21:35 -04:00
Dan Kegel 536c64b241 docs: add snippet about response file change 2020-06-05 14:15:32 -07:00
Daniel Mensinger ede2cd556c
cmake: added docs 2020-06-05 11:45:10 +02:00
Jussi Pakkanen c61f75adbf
Merge pull request #6818 from mensinda/localPatch
Wrap: add local files support via *_filename
2020-05-27 23:42:30 +03:00
Daniel Mensinger c9cd235af4 opts: added docs 2020-05-26 13:48:26 -04:00
Daniel Mensinger 550a450324
ast: Add docs for --ast 2020-05-23 18:20:12 +02:00
Dylan Baker 29ef4478df compilers/d: Add b_ndebug support
D lang compilers have an option -release (or similar) which turns off
asserts, contracts, and other runtime type checking. This patch wires
that up to the b_ndebug flag.

Fixes #7082
2020-05-20 14:20:26 -07:00
Dylan Baker af787874a8 pass exe_wrapper to test scripts through the environment
This adds a new MESON_EXE_WRAPPER environment variable containing the
string form of the exe_wrapper, if there is an exe_wrapper defined.

Fixes #4427
2020-05-18 13:53:58 -07:00
Jussi Pakkanen 751ea3df72
Merge pull request #7103 from dankegel/bug4027-rpath-remember
Let .pc files and LDFLAGS provide rpaths.
2020-05-18 23:17:34 +03:00
Dan Kegel ac8319add1 docs: add snippet documenting rpath behavior change 2020-05-16 20:51:37 +00:00
Dylan Baker a63e36f7b1 interpreter: Rename has_exe_wrapper -> can_run_host_binaries
The implementation of this function has changed enough that the name
doesn't really reflect what it actually does. It basically returns true
unless you're cross compiling, need and exe_wrapper, and don't have one.

The original function remains but is marked as deprecated.

This makes one small change the meson source language, which is that it
defines that can_run_host_binaries will return true in build == host
compilation, which was the behavior that already existed. Previously
this was undefined in build == host compilation.
2020-05-14 11:04:51 -07:00
Xavier Claessens 245d659522 ConfigToolDependency: Don't fallback to system tool when cross compiling
The system tool is always the wrong thing to use and cause hard to debug
issues when trying to link system libraries with cross built binaries.

The ExternalDependency base class already had a method to deal with
this, used by PkgConfigDependency and QtBaseDependency, so it should
make things more consistent.
2020-05-11 18:02:37 -04:00
Paolo Bonzini 7e15295018 rename unstable-kconfig to unstable-keyval
Discussions in #6524 have shown that there are various possible uses of the
kconfig module and even disagreements in the exact file format between
Python-based kconfiglib and the tools in Linux.  Instead of trying to
reconcile them, just rename the module to something less suggestive and
leave any policy to meson.build files.

In the future it may be possible to add some kind of parsing through
keyword arguments such as bool_true, quoted_strings, etc. and possibly
creation of key-value lists too.  For now, configuration_data objects
provide an easy way to access quoted strings.  Note that Kconfig stores
false as "absent" so it was already necessary to write "x.has_key('abc')"
rather than the more compact "x['abc']".  Therefore, having to use
configuration_data does not make things much more verbose.
2020-05-08 20:56:14 +03:00
Jussi Pakkanen 4ea7c6ee12
Merge pull request #7064 from dcbaker/gtest-protocol
Add support for Gtest as a test protocol
2020-05-06 23:57:44 +03:00
Dylan Baker 083c5f6357 Add native support for gtest tests
Gtest can output junit results with a command line switch. We can parse
this to get more detailed results than the returncode, and put those in
our own Junit output. We basically just throw away the top level
'testsuites' object, then fixup the names of the tests, and shove that
into our junit.
2020-05-04 11:33:19 -07:00
Jussi Pakkanen 9a6e79dc68
Merge pull request #7060 from dcbaker/install-script-targets
Allow meson.add_*_script to take additional types
2020-05-03 23:20:59 +03:00
Dylan Baker 1bfeaadd6d Docs: Update link_language docs to explain when it should be used 2020-04-30 11:52:45 -07:00
Dylan Baker 81f35f1549 docs: Update documentation for add_*_script 2020-04-30 10:01:14 -07:00
Xavier Claessens 39a69d1fb0 find_program: Fixes when the program has been overridden by executable
- ExternalProgramHolder has path() method while CustomTargetHolder and
  BuildTargetHolder have full_path().
- The returned ExternalProgramHolder's path() method was broken, because
  build.Executable object has no get_path() method, it needs the
  backend.
- find_program('overridden_prog', version : '>=1.0') was broken because
  it needs to execute the exe that is not yet built. Now assume the
  program has the (sub)project version.
- If the version check fails, interpreter uses
  ExternalProgramHolder.get_name() for the error message but
  build.Executable does not implement get_name() method.
2020-04-28 01:39:56 +03:00
Daniel Mensinger 5e5895814f
wrap: Updated docs 2020-04-25 16:03:16 +02:00
Dylan Baker 7b7f93a09f mtest: Generate a JUnit xml result file
JUnit is pretty ubiquitous, lots of services and results viewers
understand it, in particular gitlab and jenkins know how to consume
JUnit xml. This means projects using CI services can have their test
results consumed automatically.

Fixes: #6972
2020-04-23 13:26:01 -07:00
Xavier Claessens a6239d5100 wrap: Add fallback urls
It can happen that a server is temporaly down, tarballs often have
many mirrors available so we should be able to add at least one fallback
mirror in wrap files.
2020-04-13 13:29:33 +03:00
Xavier Claessens 8603c3b445 dist: Add --no-tests option
It is not always needed to test generated tarballs, for example when
they are generated by CI that already does its own testing.
2020-03-29 21:12:34 +03:00
Jussi Pakkanen 15b0bd6e93 Update everything for new release. 2020-03-29 20:37:15 +03:00
Xavier Claessens 4d7ccd1399 Make werror per subproject option 2020-03-24 22:48:55 +02:00
Jussi Pakkanen 7924e5f9c2 Revert "Naturally use env vars a bit more to match Autoconf"
This reverts commit 097dfc085e.
2020-03-23 18:07:24 +02:00
John Ericson 097dfc085e Naturally use env vars a bit more to match Autoconf
PR #6363 made it so our interpretation of env vars no longer clashed
with Autoconf's: if both Meson and Autoconf would read and env var, both
would do the same things with the value they read.

However, there were still cases that autoconf would read an env var when
meson wouldn't:

 - Autoconf would use `CC` in cross builds too

 - Autoconf would use `CC_FOR_BUILD` in native builds too.

There's no reason Meson can't also do this--if native cross files
overwrite rather than replace env vars, cross files can also overwrite
rather than replace env vars.

Because variables like `CC` are so ubiquitous, and because ignoring them
in cross builds just makes those builds liable to break (and things more
complicated in general), we bring Meson's behavior in line with
Autoconf's.
2020-03-23 17:51:36 +02:00
John Ericson 3a4388e51d Fix legacy env var support with cross
Fix #3969
2020-03-23 17:51:36 +02:00
Jussi Pakkanen 9e5c881b06 Add property to disable compiler sanity checks during cross compilation. 2020-03-22 23:07:53 +02:00
alanNz 7460292810 -Add xc16 and c2000 C,Cpp toolchain support 2020-03-21 00:47:24 +02:00
Camilo Celis Guzman 18373cba74 mtest: terminate a test via SIGTERM first then (if needed) via SIGKILL 2020-03-19 23:04:36 +02:00
Daniel Mensinger 673ca982f1 cmake: Add find_package COMPONETS support 2020-03-19 22:52:03 +02:00
Dylan Baker 9074c7f8a4 envconfig: Make compiler and linker environment variables match 2020-03-17 10:40:39 -07:00
Dylan Baker 20f8e47221 docs: Update documentation for GDC linker overriding 2020-03-12 13:21:04 -07:00
Dylan Baker b54e557a40 docs: Document that ldc now supports linker overriding [skip ci] 2020-03-12 21:19:47 +02:00
Jussi Pakkanen 5c51d4521a
Merge pull request #6532 from jon-turney/languages-native-kwarg
Add add_languages(native:)
2020-03-09 01:20:57 +02:00
Jussi Pakkanen 7234316dc7
Merge pull request #6688 from dcbaker/emcc-linker-bugs
Emcc linker bugs and improvments
2020-03-08 14:04:48 +02:00
Xavier Claessens ecb076ba00 qt5: Add has_tools() method 2020-03-08 13:48:27 +02:00
Xavier Claessens 943e9368f7 Simplify dependency() fallback
Now that subprojects can override the dependency name, there is no need
to provide a variable name for the fallback any more.
2020-03-06 15:26:02 -05:00
Xavier Claessens 2fdedc4d0f Add meson.override_dependency()
Similar to meson.override_find_program() but overrides the result of the
dependency() function.

Also ensure that dependency() always returns the same result when
looking for the same dependency, this fixes cases where parts of the
project could be using a system library and other parts use the library
provided by a subproject.
2020-03-06 15:25:46 -05:00
Dylan Baker 1210a67f66 mesonbuild: Add mcompile command
This is tested working with both msbuild and ninja/samu. Since our xcode
support is pretty much broken I didn't bother.

Fixes #6670
2020-03-04 14:07:27 -05:00
Stéphane Cerveau a46f0a6202 interpreter: add 'name' method to BuildTargetHolder
As any child of BuildTargetHolder might need the name of the object,
provides a method to get object name.
This is useful in gst-build to display the plugin name and not
the filename.
2020-03-04 13:49:01 -05:00
Michael 2f080b1f2e add -C to meson init 2020-03-02 13:50:58 -05:00
Jussi Pakkanen 200738a3e6
Merge pull request #6692 from xclaesse/summary-warnings
Summary improvements
2020-03-01 19:30:10 +02:00
Jon Turney 96f661e150
Add release note snippet 2020-02-28 11:54:09 +00:00
Dylan Baker 654f427759 compilers/linkers: Add a representation for wasm-ld
Emscripten does have a stand alone linker, wasm-ld. This patch adds the
linker, adds detection for the linker, and removes the IsLinkerMixin for
emscripten. This is a little more correct, and makes the code a lot
cleaner and more robust.
2020-02-27 16:35:02 -08:00
Dylan Baker 771b0d3ffb compilers/mixins/emscripten: Implement thread support
Emscripten has pthread support (as well as C++ threads), but we don't
currently implement them. This fixes that by adding the necessary code.
The one thing I'm not sure about is setting the pool size. The docs
suggest that you really want to do this to ensure that your code works
correctly, but the number should really be configurable, not sure how to
set that.

Fixes #6684
2020-02-27 16:35:02 -08:00
Xavier Claessens 8101b0ddab summary: Add more info in Subprojects section
This adds a warnings counter for subprojects that passed. This is to
encourage developpers to check warnings in the logs and hopefully fix
them. Otherwise they could be hidden in hundreds lines of logs.

This also print the error message for subprojects that did not pass. The
error message is often enough to fix the issue (e.g. missing
dependency) and it's easier than searching in the logs why a subproject
failed.
2020-02-26 14:24:12 -05:00
Xavier Claessens c175e97a88 summary: Add list_sep keyword argument
This allows having lists on a single line instead of having each value
aligned on a new line.
2020-02-26 14:24:12 -05:00
Jussi Pakkanen fb2b637bbb Typo fix. [skip ci] 2020-02-25 20:39:45 +02:00
Jussi Pakkanen 999376a347 Document the project policy on mixing build systems. [skip ci] 2020-02-25 20:28:28 +02:00
Jussi Pakkanen 9c604320a0
Merge pull request #6637 from mesonbuild/nirbheek/implement-symbolextractor-windows
Implement symbolextractor on windows + some cleanups/fixes
2020-02-23 20:23:03 +02:00
Nirbheek Chauhan be486a2ec8 ninjabackend: List PDBs in output list for targets
This is more correct, and forces the target(s) to be rebuilt if the
PDB files are missing. Increases the minimum required Ninja to 1.7,
which is available in Ubuntu 16.04 under backports.

We can't do the same for import libraries, because it is impossible
for us to know at configure time whether or not an import library will
be generated for a given DLL.
2020-02-22 06:49:34 +05:30
Rohan Garg 73f03e6093 Introduce dataonly for the pkgconfig module
This allows users to disable writing out the inbuilt variables to
the pkg-config file as they might actualy not be required.

One reason to have this is for architecture-independent pkg-config
files in projects which also have architecture-dependent outputs.

For example : https://gitlab.freedesktop.org/wayland/weston/issues/269

Fixes #4011
2020-02-20 10:19:19 -05:00
Nirbheek Chauhan 53265e3bc2 minstall: Add a new option --quiet
This is a significant speed-up on Windows because terminals are
slow to print things out.

Speed-up in gst-build on Windows:

```
meson install:
before: 5.1 seconds
after:  4.0 seconds
```
2020-02-17 23:58:20 +05:30
Jussi Pakkanen 47759550e5 Add unity block size option. 2020-02-12 22:31:08 +02:00
Jon Turney c5a32c2afe
Refine behaviour of add_languages() when native: is missing
This improves the common case of a simple meson.build which doesn't
contain any 'native: true' targets to not require a native compiler when
cross-compiling, without needing any changes in the meson.build.

v2:
Do it the right way around!
2020-02-12 13:33:00 +00:00
Jon Turney 7a159ff1e1
Add add_languages(native:)
v2:
Retain not using logical-and, to avoid short-circuiting side-effects
of add_languages()
2020-02-09 16:01:34 +00:00
Jussi Pakkanen 31d89a4ed2
Merge pull request #6421 from dcbaker/zlib-system-dep
Add a "system" dependency for zlib
2020-02-07 21:15:55 +02:00