Commit Graph

412 Commits

Author SHA1 Message Date
Jussi Pakkanen 55a7c265c1
Merge pull request #2863 from jon-turney/exit-status-on-exception
Verify that failing tests are failing with an error, not a python exception
2018-02-18 13:54:50 +02:00
Jussi Pakkanen 1841d53a84
Merge pull request #2943 from ximion/master
Don't fail loading subprojects if subprojects_dir is in a subdirectory
2018-02-18 13:50:57 +02:00
Matthias Klumpp a64a237d72 Don't mention "error" in error messages
Starting with VS 2017 if the output of any command run by VS contains
the word Error it will interpret that as a fatal error, even if the exit
error code is zero.
This messes up the unit tests on VS 2017, because we sometimes want to
deliberately ignore error messages.
Change "Error" to "Problem" to mitigate this issue until a more
permanent solution is found.
2018-02-17 23:20:26 +01:00
Jon Turney 9e6d3f903c Only expose exception() test function during unit tests 2018-02-15 12:51:25 +00:00
Jon Turney b78a01bced Add a test case for python exception exit status 2018-02-15 12:51:25 +00:00
Jussi Pakkanen 9dc995b3e9 Permit path separators in subproject names but with a warning. Closes #2794. 2018-02-14 23:59:20 +02:00
Jussi Pakkanen e2b5ac29d6 Only add reconfigure deps on files, not dirs. Closes #2919. 2018-02-14 19:14:30 +02:00
Hemmo Nieminen d0f620364f Fix a stack trace caused by subproject.get_variable('non-existing'). 2018-02-13 21:29:32 +02:00
Jussi Pakkanen ca4cbab004 Use absolute path if relative can not be evaluated. Closes #2784. 2018-02-13 21:28:42 +02:00
Matthias Klumpp 3274f951d2 Don't fail loading subprojects if subprojects_dir is in a subdirectory 2018-02-12 19:12:44 +01:00
Matthias Klumpp f35606f61e Show a better error message if subproject can not be configured
Previously, Meson was showing a subproject being downloaded after later
claiming it doesn't exist.
This patch shows the actual error to clarify why the given subproject
can not be used.
2018-02-12 19:12:44 +01:00
Jussi Pakkanen 54d7817087 User options can "yield to" a user option of the same name in superproject. Closes ##2853. 2018-02-08 00:33:44 +02:00
Aleksey Filippov 549f9a41e5 Rename install_subdir() option elide_directory to strip_directory 2018-02-05 01:28:07 +00:00
Aleksey Filippov 8ca3cc0c3d Add elide_directory keyword for install_subdir() function
If elide_directory=true install_subdir() installs directory contents
instead of directory itself, eliding name of the source directory.

Closes #2869.
2018-02-05 01:28:07 +00:00
Jussi Pakkanen bfa6c8d074
Merge pull request #2938 from acfoltzer/rust-cross-merge
Add cross-compilation support for `rustc`
2018-02-04 00:44:09 +02:00
Aleksey Filippov 8fe8161014 Refactor and simplify install_subdir()
- Pass exclude_files and exclude_directories relative to src_dir,
  same as specified by user and documented in public install_subdir().
- Make do_copydir() interface similar to do_copyfile():
  install src_dir contents to dst_dir.
- Remove src_prefix/src_dir code, it adds confusion and duplicates arguments.
  Use single src_dir parameter instead.
- Make callers specify that src_dir contents should be installed
  under dst_dir/basename(src_dir) if necessary.
- Use os.path.relpath() instead of string manipulations on paths.
- Add documentation to do_copydir(): specify types and add usage example.
2018-02-04 00:43:00 +02:00
Jussi Pakkanen 2601cbe8a8 Created an unstable module for IceStorm projects. 2018-02-02 20:05:31 +02:00
Martin Kelly 36aca4cd3c add meson.project_license() builtin
This Fixes #2941.
2018-01-31 23:54:28 +02:00
Jussi Pakkanen af2067b670 Make checks a bit more robust against empty entries. 2018-01-31 21:01:28 +02:00
Adam C. Foltzer 1d81efb03d Add cross-compilation support for `rustc`
This patch is largely modeled on the relatively-straightforward code
for Fortran cross-compilation, so there might be some intricacies
missing.
2018-01-29 15:47:05 -08:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename
are defined as follows:
    os.path.dirname() = os.path.split()[0]
    os.path.basename() = os.path.split()[1]
For the purpose of better readability split() is replaced
by appropriate function if only one part of returned tuple
is used.

[1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30 07:08:22 +11:00
Jon Turney 6a1a56ab57 Report warning/error locations in a format IDEs may already know how to parse
Examples:

meson.build:2:0: ERROR: Dependency is both required and not-found
meson.build:4: WARNING: Keyword argument "link_with" defined multiple times.

These are already matched by the default compilation-error-regexp-alist in
emacs.

Also:
Don't start 'red' markup until after the \n before an error
Unabsorb full-stop at end of warning with location from mlog.warning()
Update warning_location test
2018-01-30 06:48:22 +11:00
Jussi Pakkanen 59d0434039 Removed two deprecations from 2016. 2018-01-17 22:12:43 +02:00
Raphael Salamon 4cae553cb1 Add `main` argument to `dependency` (#2828)
`GTest` uses this keyword for conditional linking of it's main().

Fixes issue #2828
2018-01-17 21:00:45 +02:00
Jussi Pakkanen d6bed2a77d
Merge pull request #2764 from mesonbuild/generatorpath
Generator outputs can have path segments
2018-01-13 19:00:38 +02:00
Christophe Gouiran 81100f0695 Change handling of not found external programs 2018-01-11 00:34:19 +02:00
Nikita Churaev de8018a17d Add `export_dynamic` argument to `executable`. (#2662) 2018-01-09 21:36:13 +02:00
Matthias Klumpp 894ff1e629 Ensure subproject_dir is a string and doesn't contain ".." segments
This is important so people can not trick Meson to select a
subproject_dir that is not in the project's source directory.
It also ensures a string is used for the path.
2018-01-07 19:28:22 +01:00
Matthias Klumpp 0da6d891ac Allow subproject dirs in subdirectories in the source tree again
The previous change disallowed any subdirectories for subproject dirs,
and therefore broke a couple of projects making use of that.
This change still prevents people from setting subproject dirs that are
not in the project's source tree, while allowing to specify any path
within the project's directory again.

Resolves: #2719
2018-01-07 18:23:56 +01:00
Jussi Pakkanen 65f78a722a
Merge pull request #2856 from jon-turney/warning-location
Consolidate warning location formatting
2018-01-03 22:32:40 +02:00
Jussi Pakkanen ad54bc3726
Merge pull request #2838 from mesonbuild/nirbheek/consolidate-subproject-dep-checking
intrp: Consolidate subproject dep checking and logging
2018-01-02 20:35:19 +02:00
Jon Turney f85fde743a Wire up locations in a couple more warnings
These are the remaining warnings in the parser, where we have the location
to hand.
2018-01-01 13:21:00 +00:00
Jon Turney 2ed875e1b4 Consolidate warning location formatting in mlog.warning()
Also use .format() rather than %
Also use build.environment rather than hardcoding 'meson.build'
2018-01-01 13:20:55 +00:00
Nirbheek Chauhan 851475db9b intrp: Consolidate subproject dep checking and logging
If a dep is not found on the system and a fallback is specified, we
have two cases:

1. Look for the dependency in a pre-initialized subproject
2. Initialize the subproject and look for the dependency

Both these require version comparing, ensuring the fetched variable
is a dependency, and printing a success message, erroring out, etc.

Now we share the relevant code instead of duplicating it. It already
diverged, so this is a good thing.

As a side-effect, we now log fallback dependencies in the same format
as system dependencies:

    Dependency libva found: YES
    Dependency libva found: YES (cached)

    Dependency glib-2.0 from subproject subprojects/glib found: YES
    Dependency glib-2.0 from subproject subprojects/glib found: YES (cached)
2018-01-01 01:14:03 +05:30
Jon Turney ad5cc2ce55 Append warning location to warning output by warning() 2017-12-30 20:10:15 +00:00
Karol Szuster 8fb7d9261a Add missing space 2017-12-27 00:41:09 +02:00
Jussi Pakkanen ac8d6087bf
Merge pull request #2334 from mesonbuild/promotedep
Add functionality to promote nested dependencies to top level.
2017-12-26 13:24:30 +02:00
Jussi Pakkanen 1806aac376
Merge pull request #2817 from jon-turney/master
Update prefix-dependent defaults when project(default_options:) changes prefix
2017-12-26 13:22:03 +02:00
Niklas Claesson 7f4f082d69 Print 'cached' if dependency is found in cache 2017-12-22 01:44:56 +01:00
Niklas Claesson ba161d42ee subproject handling: add fix 2017-12-22 00:59:19 +01:00
Jon Turney 861cbc2e73 Update prefix-dependent defaults when project(default_options:) changes prefix
Fixes #2811
2017-12-21 19:21:49 +00:00
Jussi Pakkanen b6dd50db31
Merge pull request #2791 from behlec/compiler-version
Add more version information to compiler
2017-12-20 20:42:01 +02:00
Jussi Pakkanen b949c4792d Preserve_path_from should be a kwarg of process(), not generator(). 2017-12-17 22:42:20 +02:00
Jussi Pakkanen 5b9d79b902 Print instructions on how to promote subsubprojects. 2017-12-17 21:19:22 +02:00
Christoph Behle 7bd30c522b Fix flake8 issues. 2017-12-16 16:12:46 +01:00
Christoph Behle c6acf75617 More version information for compilers.
See issue #2762
Adds full_version to class Compiler. If set full_version will be printed
additionally.
Added support for CCompiler and CPPCompiler
Added support for gcc/g++, clang/clang++, icc.
2017-12-16 14:52:08 +01:00
Jussi Pakkanen 88756bfe95 Print UTF-8 warning only when actually encountering non-ascii filenames. 2017-12-14 23:49:12 +02:00
Jussi Pakkanen 4af4145d09 Files created with generator can have path segments.
This is OK, because they are written in the private directory
of each target and its layout can be anything.
2017-12-12 00:02:37 +02:00
Jussi Pakkanen bc83c58d37
Merge pull request #2731 from mesonbuild/disabler
Created disabler object type
2017-12-05 01:10:50 +02:00
Jon Turney 87e6201214 Document and improve not-found dependency objects
Document dependency('', required:false) usage.
Avoid emitting 'Dependency  found: NO'.
2017-12-05 01:04:57 +02:00