Commit Graph

6904 Commits

Author SHA1 Message Date
David Fort ceaebf6bac add support for generating cmake files
This new cmake module allows to generate cmake package files. This may ease the
porting for cmake projects that are exporting cmake package informations for other
depending projects. The module uses as much as possible the templates provided by
the cmake installation (and so cmake needs to be installed).
2019-01-17 20:48:28 +02:00
Luca Boccassi 267792174c custom_target: do not let install override build_by_default
A custom_target, if install is set to true, will always be built by
default even if build_by_default is explicitly set to false.
Ensure that this does not happen if it's set explicitly. To keep
backward compatibility, if build_by_default is not set explicitly and
install is true, set build_by_default to true.

Fixes #4107
2019-01-17 20:40:19 +02:00
Dylan Baker dbe2a29637 coredata: Serialize native files into the cmd_line.txt file
Because we need to store those as well.
2019-01-17 13:21:00 -05:00
Dylan Baker 8668a4e2ec coredata: Handle EOFError like UnpicklingError
If the coredata file has been truncated, that's pretty much the same as
being corrupt, handle that via the same path.
2019-01-17 13:21:00 -05:00
Dylan Baker ed0ad91f1c coredata: Handle AttributeError in unpickling coredata
Which can happen due to internal refactorings, such as the removal of
the ConfData class between 0.49 and 0.50
2019-01-17 13:21:00 -05:00
Jussi Pakkanen e6df5a7586
Merge pull request #4719 from ocrete/fix-posix-lang
Replace surrogates with valid codepoints to print env
2019-01-17 00:40:56 +02:00
Michael Hirsch, Ph.D 2ba2c7771f allow nested if loop
close paren
2019-01-16 23:43:30 +02:00
Daniel Mensinger af38722f89 mintro: Introspection interpreter refactoring (#4733)
* Fixed spelling

* Merged the Buildoptions and Projectinfo interpreter

* Moved detect_compilers to Environment

* Added removed test case

* Split detect_compilers and moved even more code into Environment

* Moved set_default_options to coredata

* Small code simplification in mintro.run

* Move cmd_line_options back to `environment`

We don't actually wish to persist something this unstructured, so we
shouldn't make it a field on `coredata`. It would also be data
denormalization since the information we already store in coredata
depends on the CLI args.
2019-01-16 23:42:54 +02:00
Daniel Mensinger 2bb69ad50b Renamed unit test directories 2019-01-16 19:10:47 +02:00
Xavier Claessens 66ac6f6b3d find_external_dependency: Return NotFoundDependency()
The returned not-found object can be from any type because we were
returning the first of the failed attempts. It also can happen that we
don't have any dependency object in which case we should just return
NotFoundDependency() object as well instead of raising an exception.
That exception was happening before, but dependency_impl() was
calling find_external_dependency() in a try block so it was hidden.
2019-01-16 11:16:46 -05:00
Xavier Claessens 339ee5137b Fix missing language in unit test
If the project as no language, ctdep.clib_compiler
is None in get_pcap_lib_version() and it raise an exception.
2019-01-16 11:16:46 -05:00
Xavier Claessens cb20f3104e ConfigTool: Avoid None being printed in logs
When req_version is None (e.g. pcap-config case) it gets printed in the
logs.

Take this opportunity to reformat the message to look more like
ExternalProgram messages.
2019-01-16 11:16:46 -05:00
Xavier Claessens 83766b3687 Fix flake8 errors 2019-01-16 11:16:46 -05:00
Xavier Claessens 815f1205a8 do_subproject: Improve log messages and formatting 2019-01-16 11:16:46 -05:00
Xavier Claessens af643d6409 extract_required_kwarg: Fix typo 2019-01-16 11:16:46 -05:00
Xavier Claessens 35f0f7090d dependency: Cleanup code by avoiding nested if blocks 2019-01-16 11:16:46 -05:00
Xavier Claessens 5dac8e51f4 dependency: Not all DependencyException means not-found dep 2019-01-16 11:16:46 -05:00
Xavier Claessens 335b87fcaa dependency: Add has_fallback variable 2019-01-16 11:16:46 -05:00
Xavier Claessens 1cd393c6e2 dependency_fallback: Set 'required' in subproject's kwargs
This makes error clearer because it stops exactly where the error occurs
during the subproject configuration.
2019-01-16 11:16:46 -05:00
Xavier Claessens 2867371f1a dependency_fallback: Pass display_name in arguments 2019-01-16 11:16:46 -05:00
Xavier Claessens bdf301d05b do_subproject: InvalidCode is always an error
Not need to catch exceptions in dependency_fallback(), it's already
handled in do_subproject(). This ensure subproject errors are handled
the same way when doing dependency() fallback and when doing
subproject().
2019-01-16 11:16:46 -05:00
Xavier Claessens f6a34c8aaf dependency_fallback: Simplify useless try block 2019-01-16 11:16:46 -05:00
Xavier Claessens b209a3cd8f dependencies: Avoid duplicated code
The dependency version from a subproject was checked in two different
places. Do it in get_subproject_dep().
2019-01-16 11:16:46 -05:00
Xavier Claessens a92b41fdcd dependencies: Remove version from cache key
We cannot have 2 different versions with all other kwargs being
identical. This simplifies a lot that code.
2019-01-16 11:16:46 -05:00
Alistair Thomas 2f72d4db09 docs: Explain how to use a Vala project's VAPI files with find_library() [skip ci]
The Vala compiler object's find_libary() method needs the 'dir' keyword to
add a project's local vapi dir to the VAPI search path.

See https://github.com/mesonbuild/meson/issues/4702
2019-01-15 21:47:17 +02:00
Olivier Crête 92b343f2f7 mesonmain: Force to output UTF-8 even when the locale isn't
Otherwise Python gets all confused and it makes testing difficult.

Also minimally emulate the behaviour of the normal object to make the rest
of the code happy.
2019-01-15 14:01:32 -05:00
Jussi Pakkanen bbcf80d734 Remove argv2, which is not supported by polkit. Closes #4758. 2019-01-15 20:28:44 +02:00
Daniel Mensinger 609ecba37f mintro: Added `defined_in` key in the targets introspection 2019-01-15 20:28:12 +02:00
Michael Hirsch, Ph.D fff88b354a restore PGI compile functioning 2019-01-15 20:27:31 +02:00
Shubham Lagwankar 4de093c8d5 Fix typo [skip ci] 2019-01-14 23:18:41 +02:00
Jussi Pakkanen 348bd39083
Merge pull request #4764 from mensinda/introVersCheck
mintro: Check meson-info.json version instead of loading coredata
2019-01-14 00:17:03 +02:00
John Ericson b53c982b58 Build class should not duplicate compiler state
Compilers should be held by coredata, so this is just here for
convenience.
2019-01-14 00:16:36 +02:00
Daniel Mensinger 96f354ebde
Load source dir from meson-info.json 2019-01-13 19:04:57 +01:00
Daniel Mensinger 243eca6cee
mintro: Check meson-info.json version instead of loading coredata 2019-01-13 19:01:38 +01:00
Marco Trevisan (Treviño) 95c1cdf776 interpreter: obey to the install argument in configure_file
If a configure_file has an install_dir set, the supported install
argument is ignored, while this should have actually higher priority
than the install_dir itself.
Also check that correct types are used for `install` and `install_dir`.

Add test to verify this.

Fixes #3983
2019-01-13 19:51:31 +02:00
Jussi Pakkanen 49557e15ec
Merge pull request #4731 from mensinda/introBreak2
mintro: Changes to the introspection API
2019-01-13 19:50:10 +02:00
Antoine Jacoutot e02b79dc1e OpenBSD: register machine cpu "macppc" as cpu_family "ppc"
On OpenBSD, the main PowerPC machine is known as macppc, while the processor
family is powerpc:
$ uname -{m,p}
macppc powerpc
$ echo 'import platform; print (platform.machine())' | python3
macppc
$ echo 'import platform; print (platform.processor())' | python3
powerpc

This allows for e.g. GLib configure to properly detect that cpu:
Build machine cpu family: ppc
Build machine cpu: macppc
While it failed before with: WARNING: Unknown CPU family 'macppc' <snip>
2019-01-13 14:23:16 +02:00
Jon Turney 680d266591 Fix a typo in an error message 2019-01-11 20:58:43 +02:00
Jussi Pakkanen fa562d8100
Merge pull request #4744 from dcbaker/docs-cflags
Discourage the use of env variables like CFLAGS [skip ci]
2019-01-10 23:05:57 +02:00
John Ericson 8165fa6ad0 Fix finding the static linker for native compiler in cross build
Native ar and cross ar are not the same!
2019-01-10 23:04:41 +02:00
Alistair Thomas b204a74917 rpm: Bring RPM module back in to a working state 2019-01-10 23:03:09 +02:00
John Ericson 913c87b327 `environment.cross_info.need_cross_compiler()` doesn't exist
It is no longer needed either.
2019-01-10 23:02:23 +02:00
Jussi Pakkanen 9223ffdc11
Merge pull request #4748 from astavale/running-meson-docs
docs: update 'Running Meson' page to show Meson's setup command [skip…
2019-01-10 23:02:01 +02:00
Jussi Pakkanen e5b1cf5088
Merge pull request #4746 from mesonbuild/parisc64
Report parisc64 as parisc. Closes #4714.
2019-01-10 22:59:24 +02:00
John Ericson 17a602a4ec Remove spurious case in interpreter
`need_cross_compiler = is_cross_build()`, so the condition is always
false.
2019-01-10 22:59:01 +02:00
Phillip Cao 13fe2e40eb Add get_werror_args for CCRX C compiler 2019-01-10 22:56:47 +02:00
Alistair Thomas 1b9e00f506 docs: update RunningMeson.md to show Meson's setup command [skip ci] 2019-01-10 11:34:18 +00:00
Ethan R 530aec0bbe Added Rust to supported languages for project() (#4750) [skip ci] 2019-01-09 23:46:38 +05:30
Alistair Thomas fb05733983 docs: Change sub-headings in Running-Meson.md from == to ## [skip ci] 2019-01-09 18:15:57 +00:00
Alistair Thomas 55e6d3c35e docs: Re-wrap Running-Meson.md from 70 to 80 columns [skip ci] 2019-01-09 18:15:57 +00:00