Commit Graph

459 Commits

Author SHA1 Message Date
Jussi Pakkanen 33c2bbc6e8 Merge pull request #2191 from centricular/fix-ninja-clean-target-dir
Fix ninja clean in some edge cases + a bonus windows fix
2017-08-15 00:39:49 +03:00
Nirbheek Chauhan be4428005d ninja: Fix cleaning in various edge cases
We need to use target aliases for reserved target names and run
targets to workaround a ninja bug:

https://github.com/ninja-build/ninja/issues/828

Closes https://github.com/mesonbuild/meson/issues/1644
2017-08-15 01:38:01 +05:30
Jussi Pakkanen 4a766147fb Printing unknown kwarg error message no longer crashes the parser. 2017-08-14 22:32:29 +03:00
Elliott Sales de Andrade 5cb1d00537 Allow excluding files from `install_subdir`
The install_subdir command now accepts a new `exclude` keyword argument
that allows specified files to be excluded from the installed
subdirectory.
2017-08-06 03:58:35 -04:00
Jussi Pakkanen 61a05f26e3 Add option to disable implicit include directories. Closes #2139. 2017-08-05 00:26:13 +03:00
Jussi Pakkanen d335a84b9e A few more lgtm fixes. 2017-08-04 12:54:31 +03:00
Patrick Griffis ece4ce8872 Fix test() accepting configure files for exe 2017-07-31 18:48:30 -04:00
Jussi Pakkanen a572ebd2a1 Convert man inputs to Files so you can install_man the output of configure_file. Closes #2135. 2017-07-31 18:47:09 -04:00
Jussi Pakkanen bff37a90fc Merged buildrpath branch. 2017-07-21 22:19:07 +03:00
Christoph Reiter ceea746222 configure_file: warn in case a variable to subsitute is not present in the passed configuration. Fixes #2090 2017-07-21 20:11:50 +03:00
Jussi Pakkanen 2269b7f60b Add build_rpath as new property allowing people to specify rpath entries that are used in the build tree but will be removed on install. 2017-07-21 19:40:54 +03:00
Jussi Pakkanen fc23d9d0f2 Turned SIMD into an unstable module. 2017-07-18 21:53:24 +03:00
Jussi Pakkanen f78cf53141 Created merge_from method for ConfigurationData. 2017-07-17 19:20:00 +03:00
Jussi Pakkanen fff3ded297 Removed unreachable code as == never throws. 2017-07-16 12:27:51 +03:00
Jussi Pakkanen b2a90f1838 Removed unnecessary pass statements. 2017-07-16 12:02:48 +03:00
Jussi Pakkanen 76d6fab8ae Simplified control flow. 2017-07-16 12:00:04 +03:00
Gabríel Arthúr Pétursson fd653d070d Make base options accessible via get_option() 2017-07-15 10:21:41 +02:00
Jussi Pakkanen ad3dc937f1 Fix remaining Interpreter object leaks. 2017-07-01 02:10:02 +03:00
Jussi Pakkanen c11a4cb952 Make Interpreter object unpicklable as it was being pickled by accident in copies of kwargs. 2017-07-01 00:11:27 +03:00
Aaron Plattner ba3871985a add_{project,global}_link_arguments require a 'language' argument
Commit 325a231a added stricter keyword argument checking, but didn't enable
keyword arguments for add_projects_link_arguments() and
add_global_link_arguments(). This makes them fail with this error:

 Meson encountered an error in file meson.build, line 19, column 0:
 Function does not take keyword arguments.

However, the language argument is required. Removing it produces this error
instead:

 Meson encountered an error in file meson.build, line 19, column 0:
 Missing language definition in add_project_link_arguments

Fix this by adding 'language' as a required keyword argument. Also add calls to
these in the "146 C and CPP link" test case.
2017-06-29 11:02:44 -04:00
Jussi Pakkanen 80ebc916f7 Merge pull request #2001 from mesonbuild/kwcheck
Decorator to check for unknown keyword arguments
2017-06-27 04:12:17 -04:00
Jussi Pakkanen 3262be23dc Fixed issues raised in review. 2017-06-26 23:29:42 +03:00
Guillaume Poirier-Morency fab5634916 Add 'Compiler.get_display_language'
Use this when we print language-related information to the console and
via the Ninja backend.
2017-06-26 14:15:44 -04:00
Jussi Pakkanen 50e75baa91 Removed in_builddir from public usage as it is an internal feature that was visible by accident. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen fe74c54079 Alphabetization. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen 97b7a7b10e Moved func_ methods from base class to Interpreter. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen 325a231abe Add a few more. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen f7da8dc84d A few more. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen e08d735105 Added a few more kwarg checks to functions. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen 0eb41a9a08 Checks for all build target functions. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen 92493d4e5e Added kwargs for executable(). 2017-06-26 21:10:27 +03:00
Jussi Pakkanen 46e61971ce Decorator to check for permitted kwargs. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen f792641b34 Merge pull request #1927 from centricular/gir-rpath-link
Work around GNU ld bug with -rpath,$ORIGIN
2017-06-11 14:54:10 +03:00
Nirbheek Chauhan d38f3deaed gnome: Work around GNU ld bug with -rpath,$ORIGIN
g-ir-scanner doesn't understand -rpath, so we use -L instead which
has the same effect.

Closes https://github.com/mesonbuild/meson/issues/1911
2017-06-11 14:32:39 +05:30
Nirbheek Chauhan 0c83f8352d dependencies: Add a new class ExternalDependency
This class now consolidates a lot of the logic that each external
dependency was duplicating in its class definition.

All external dependencies now set:

* self.version
* self.compile_args and self.link_args
* self.is_found (if found)
* self.sources
* etc

And the abstract ExternalDependency class defines the methods that
will fetch those properties. Some classes still override that for
various reasons, but those should also be migrated to properties as
far as possible.

Next step is to consolidate and standardize the way in which we call
'configuration binaries' such as sdl2-config, llvm-config, pkg-config,
etc. Currently each class has to duplicate code involved with that
even though the format is very similar.

Currently only pkg-config supports multiple version requirements, and
some classes don't even properly check the version requirement. That
will also become easier now.
2017-06-09 20:21:01 +05:30
Jan Chren (rindeal) bd52a5c5aa add `capture: true` ability to configure_file()
Closes: https://github.com/mesonbuild/meson/issues/1863
2017-06-07 23:46:34 +02:00
Bálint Aradi e79b602298 Enable variables for output in configure_file 2017-06-03 16:50:09 +02:00
Jussi Pakkanen 506fbafed5 Revert slashes in filenames being a hard error to give downstream projects time to transition. 2017-06-02 11:56:27 +03:00
Guillaume Poirier-Morency 93a1cff174 interpreter: Prevent top-level subdirectories from using 'meson-' prefix
These are reserved for internal usages like 'meson-private' or
'meson-logs'.
2017-05-29 19:42:03 +03:00
Jussi Pakkanen 7882549f86 Target file name must not contain a path separator as that breaks things. 2017-05-26 23:27:49 +03:00
Elliott Sales de Andrade 30645ed54b Remove extra casts on InterpreterBase.evaluate_statement.
The result of this method is always a "native" object, and code coverage
(plus a manual inspection) shows that this conversion is never done.
2017-05-17 19:43:39 -04:00
Elliott Sales de Andrade 1846eb3c77 Add super call in RunTargetHolder. 2017-05-17 19:43:23 -04:00
Elliott Sales de Andrade 34e4d32ac7 Remove dead code paths. 2017-05-17 19:43:23 -04:00
Elliott Sales de Andrade 00f89b0f6e Fix undefined variables/methods. 2017-05-17 19:43:14 -04:00
Nirbheek Chauhan 830b44867c dependencies: Only store found deps in the cache
This simplifies everything since it means we will always search for the
dependency again on the system if it wasn't found. This is particularly
important when running `ninja reconfigure` with an edited
PKG_CONFIG_PATH to point to a path that contains more pkg-config files.
2017-05-09 14:24:48 +05:30
Nirbheek Chauhan 66f0ccb39b dependencies: Fix two more edge-cases in dependency searching
Includes tests for both of them.
2017-05-09 14:24:48 +05:30
Nirbheek Chauhan 8cf29bd288 Completely overhaul caching of external dependencies
The old caching was a mess of spaghetti code layered over pasta code.

The new code is well-commented, is clear about what it's trying to do,
and uses a blacklist of keyword arguments instead of a whitelist while
generating identifiers for dep caching which makes it much more robust
for future changes.

The only side-effect of forgetting about a new keyword argument would
be that the dependency would not be cached unless the values of that
keyword arguments were the same in the cached and new dependency.

There are also more tests which identify scenarios that were broken
earlier.
2017-05-09 14:24:48 +05:30
Nirbheek Chauhan c650ba8928 interpreter: Typo in error message
'Non-existent' is the grammatically correct version. Also call it
a 'build file' since that's what everyone calls it nowadays.
2017-05-09 14:23:15 +05:30
Nirbheek Chauhan c7d71c7943 dependencies: Fix caching of native/cross dependencies
All our cached_dep magic was totally useless since we ended up using
the same identifier for native and cross deps. Just nuke all this
cached_dep code since it is very error-prone and improve the
identifier generation instead.

For instance, this is broken *right now* with the `type_name` kwarg.

Add a bunch of tests to ensure that all this actually works...

Closes https://github.com/mesonbuild/meson/issues/1736
2017-05-09 14:23:15 +05:30
Jussi Pakkanen e0cf45edf0 Merge pull request #1747 from centricular/run-command-configure-file
Some fixes to run_command()
2017-05-08 20:08:28 +02:00
Jussi Pakkanen 87666d105a Prevent going into the same directory twice via symlinks. Closes #1749. 2017-05-08 20:58:10 +03:00
Nirbheek Chauhan 333085160d run_command: Refactor + improve errors and test
Refactor to use ExternalProgram for the command instead of duplicating
that code (badly). Also improve messages to say "or not executable"
when a script/command is not found.

Also allow ExternalPrograms to be passed as arguments to
run_command(). The only thing we're doing by preventing that is
forcing people to use prog.path()
2017-05-07 01:56:47 +05:30
Nirbheek Chauhan b1df1a2bec run_command: accept built File objects too
The file will always exist by the time run_command() is invoked, so
there is no reason why we should forbid it. Also allow using File
objects as the command to run since strings are also allowed.
2017-05-07 00:20:29 +05:30
Peter Hutterer 7a3be163cb Default to project_version() in vcs_tag fallback 2017-05-05 08:11:28 +10:00
Peter Hutterer 4413122676 Check for input and output to exist in vcs_tag
Provide a proper error message, rather than the current
"Command cannot have '@INPUT0@', since no input files were specified"
which doesn't actually tell us where things are going wrong.
2017-05-05 08:11:04 +10:00
Jussi Pakkanen 108dac5c16 Store extra_files as file objects. Helps with #1686. 2017-05-04 00:17:33 +03:00
Dylan Baker a8173630ea Don't use len() to test emptiness vs not emptiness
Meson has a common pattern of using 'if len(foo) == 0:' or
'if len(foo) != 0:', however, this is a common anti-pattern in python.
Instead tests for emptiness/non-emptiness should be done with a simple
'if foo:' or 'if not foo:'

Consider the following:
>>> import timeit
>>> timeit.timeit('if len([]) == 0: pass')
0.10730923599840025
>>> timeit.timeit('if not []: pass')
0.030033907998586074
>>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass')
0.1154778649979562
>>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass")
0.08259823200205574
>>> timeit.timeit('if len("") == 0: pass')
0.089759664999292
>>> timeit.timeit('if not "": pass')
0.02340641999762738
>>> timeit.timeit('if len("foo") == 0: pass')
0.08848102600313723
>>> timeit.timeit('if not "foo": pass')
0.04032287199879647

And for the one additional case of 'if len(foo.strip()) == 0', which can
be replaced with 'if not foo.isspace()'
>>> timeit.timeit('if len("   ".strip()) == 0: pass')
0.15294511600222904
>>> timeit.timeit('if "   ".isspace(): pass')
0.09413968399894657
>>> timeit.timeit('if len("   abc".strip()) == 0: pass')
0.2023209120015963
>>> timeit.timeit('if "   abc".isspace(): pass')
0.09571301700270851

In other words, it's always a win to not use len(), when you don't
actually want to check the length.
2017-05-02 21:57:26 +03:00
Nirbheek Chauhan 0ebf79ec8b configure_file: Accept output of configure_file as input 2017-04-22 00:21:25 +05:30
Nirbheek Chauhan 723884a369 Expose the implementation language for external libraries
Ideally, all dependency objects should support this, but it's a lot of
work and isn't supported by all dependency types (like frameworks and
pkg-config), so for now just enable it for external libraries.
2017-04-21 10:15:18 -07:00
Matthias Klumpp 407130a1d2 Don't fail include_directories if the dir is only in the build path 2017-04-20 18:45:33 +03:00
Elliott Sales de Andrade a57f441b37 Raise clear error if module name doesn't exist.
Don't raise a full backtrace.
2017-04-17 12:43:57 +03:00
Jussi Pakkanen b48daeda1a Make it possible to only do unity builds on subprojects. 2017-04-15 18:28:36 +03:00
Nirbheek Chauhan 371e3d3e87 install scripts: Actually check if it was found
Closes https://github.com/mesonbuild/meson/issues/1600
2017-04-11 16:39:24 +03:00
Jussi Pakkanen 1652dccea2 Merge pull request #1469 from centricular/install-secondary-outputs
Support multiple install dirs for built/custom targets
2017-04-09 21:57:46 +03:00
Jussi Pakkanen 761b28371a Merge pull request #1518 from centricular/mesonintrospect-evar
Export MESONINTROSPECT to postconf/install/run_command scripts
2017-04-08 21:25:25 +03:00
Philipp Ittershagen a00ab548eb add_project_arguments: allow call after subproject()
This commit fixes #1554 by removing the restriction of add_project_arguments()
to be called before any subproject() statement.
2017-04-07 21:07:57 +02:00
Philipp Ittershagen 69d07fe75a add_{project,global}_arguments: support language list
This patch adds support for specifying a list of languages when calling
add_project_arguments and add_global_arguments.
2017-04-06 23:49:26 +02:00
Philipp Ittershagen dd9f75e188 Refactor function_add_{global,project}_{link_,}arguments common code 2017-04-06 23:30:31 +02:00
Jussi Pakkanen b42adc8a54 Merge pull request #1511 from centricular/get-define
New compiler function: cc.get_define()
2017-04-05 00:02:41 +03:00
Nirbheek Chauhan 41769d0c10 Prohibit ':' in project names
This would make it harder to parse an option to mesonconf such
as -Dfoo:bar:baz:fun=value since it could mean either of these:

* For subproject 'foo:bar:baz', set the option 'fun' to 'value'
* For subproject 'foo:bar', an invalid option 'baz:fun' was set

To differentiate between these two we'd need to create the list of
subprojects first and then parse their options later, which
complicates the parsing quite a bit.
2017-04-05 01:30:34 +05:30
Nirbheek Chauhan 6042e21e25 Use CPPFLAGS for pre-processor compiler checks
Also don't add CFLAGS twice for links() checks

Includes a test for this.
2017-04-04 23:38:36 +05:30
Nirbheek Chauhan de47541e6c New compiler function: cc.get_define()
Runs the pre-processor and fetches the value of the define.

Can find any arbitrary value and returns it as a string.
2017-04-04 22:30:13 +05:30
Nirbheek Chauhan 57cb1f9aad Support multiple install dirs for built/custom targets
You can now pass a list of strings to the install_dir: kwarg to
build_target and custom_target.

Custom Targets:
===============
Allows you to specify the installation directory for each
corresponding output. For example:

    custom_target('different-install-dirs',
      output : ['first.file', 'second.file'],
      ...
      install : true,
      install_dir : ['somedir', 'otherdir])

This would install first.file to somedir and second.file to otherdir.

If only one install_dir is provided, all outputs are installed there
(same behaviour as before).

To only install some outputs, pass `false` for the outputs that you
don't want installed. For example:

    custom_target('only-install-second',
      output : ['first.file', 'second.file'],
      ...
      install : true,
      install_dir : [false, 'otherdir])

This would install second.file to otherdir and not install first.file.

Build Targets:
==============
With build_target() (which includes executable(), library(), etc),
usually there is only one primary output. However some types of
targets have multiple outputs.

For example, while generating Vala libraries, valac also generates
a header and a .vapi file both of which often need to be installed.
This allows you to specify installation directories for those too.

    # This will only install the library (same as before)
    shared_library('somevalalib', 'somesource.vala',
      ...
      install : true)

    # This will install the library, the header, and the vapi into the
    # respective directories
    shared_library('somevalalib', 'somesource.vala',
      ...
      install : true,
      install_dir : ['libdir', 'incdir', 'vapidir'])

    # This will install the library into the default libdir and
    # everything else into the specified directories
    shared_library('somevalalib', 'somesource.vala',
      ...
      install : true,
      install_dir : [true, 'incdir', 'vapidir'])

    # This will NOT install the library, and will install everything
    # else into the specified directories
    shared_library('somevalalib', 'somesource.vala',
      ...
      install : true,
      install_dir : [false, 'incdir', 'vapidir'])

true/false can also be used for secondary outputs in the same way.

Valac can also generate a GIR file for libraries when the `vala_gir:`
keyword argument is passed to library(). In that case, `install_dir:`
must be given a list with four elements, one for each output.

Includes tests for all these.

Closes https://github.com/mesonbuild/meson/issues/705
Closes https://github.com/mesonbuild/meson/issues/891
Closes https://github.com/mesonbuild/meson/issues/892
Closes https://github.com/mesonbuild/meson/issues/1178
Closes https://github.com/mesonbuild/meson/issues/1193
2017-04-04 14:59:13 +05:30
Philipp Ittershagen adebed8ec8 Enable File() objects as an input parameter to configure_file
The configure_file command raised an exception when an input was specified as a
File, because os.path.join does not take File objects directly.  This patch
converts a File object to a string and adjusts the subsequent os.path.join
calls.
2017-04-03 21:09:31 +02:00
Jussi Pakkanen c7f66c3a9e Merge pull request #1505 from centricular/dont-use-c++-for-assembly
Try harder to use the C compiler for compiling asm
2017-04-02 00:15:22 +03:00
Tim-Philipp Müller 8cc89e468d configure_file: make input arg optional if command is used
Fixes #1476
2017-03-29 21:24:06 +03:00
Nirbheek Chauhan 27f5f0a963 Export MESONINTROSPECT to postconf/install/run_command scripts
Points to the `mesonintrospect.py` script corresponding to the
currently-running version of Meson.

Includes a test for all three methods of running scripts/commands.

Closes https://github.com/mesonbuild/meson/issues/1385
2017-03-28 00:55:01 +05:30
Nirbheek Chauhan 98e71e1e65 Allow not-required not-found dependencies in subprojects
Closes https://github.com/mesonbuild/meson/issues/1474
2017-03-27 22:02:06 +03:00
Nirbheek Chauhan 1ff0fccc29 Fix typo in dependency invalid arguments error 2017-03-27 18:35:24 +05:30
Nirbheek Chauhan 001cf52c3a Try even harder to use the C compiler for assembly
Now as long as you have a C compiler available in the project, it will
be used to compile assembly even if the target contains a C++ compiler
and even if the target contains only assembly and C++ sources.

Earlier, the order in which sources appeared in a target would decide
which compiler would be used.

However, if the project only provides a C++ compiler, that will be
used for compiling assembly sources.

If this breaks your use-case, please tell us.

Includes a test that ensures that all of the above is adhered to.
2017-03-27 14:40:34 +05:30
Nirbheek Chauhan ee3010e767 Don't require a language/compiler for configuring
Not really needed for projects that don't compile anything.

Closes https://github.com/mesonbuild/meson/issues/1208
2017-03-27 11:25:22 +05:30
Nirbheek Chauhan 14d0f38158 Try harder to use the C compiler for compiling asm
Use an ordered dict for the compiler dictionary and sort it according
to a priority order: fortran, c, c++, etc.

This also ensures that builds are reproducible because it would be
a toss-up whether a C or a C++ compiler would be used based on the
order in which compilers.items() would return items.

Closes https://github.com/mesonbuild/meson/issues/1370
2017-03-27 11:25:22 +05:30
Tim-Philipp Müller 3bb3c9ce52 declare_dependency: flatten dependencies kwargs allowing [] as no-op dep
An empty / no-op dependency can be expressed as []. This works with
the dependencies kwarg in executable targets such as shared_library,
but now with declare_dependency, where it would error out with
"error: Dependencies must be external deps" because the deps are
not flattened in this case. This patch fixes that.

Fixes #1500
2017-03-25 20:30:15 +02:00
Nirbheek Chauhan d5975cc683 wrap: Implement special wrap modes for use by packagers
Special wrap modes:
  nofallback: Don't download wraps for dependency() fallbacks
  nodownload: Don't download wraps for all subproject() calls

Subprojects are used for two purposes:
1. To download and build dependencies by using .wrap files if they
   are not provided by the system. This is usually expressed via
   dependency(..., fallback: ...).
2. To download and build 'copylibs' which are meant to be used by
   copying into your project. This is always done with an explicit
   subproject() call.

--wrap-mode=nofallback will never do (1)
--wrap-mode=nodownload will do neither (1) nor (2)

If you are building from a release tarball, you should be able to
safely use 'nodownload' since upstream is expected to ship all
required sources with the tarball.

If you are building from a git repository, you will want to use
'nofallback' so that any 'copylib' wraps will be download as
subprojects.

Note that these options do not affect subprojects that are git
submodules since those are only usable in git repositories, and you
almost always want to download them.
2017-03-25 06:57:30 +05:30
Nirbheek Chauhan a60d688973 wrap: Initialize subprojects that are git submodules
This will benefit projects such as GNOME Recipes that prefer using
submodules over wraps because it's easier to maintain since git is
aware of it, and because it integrates with their existing
workflow. Without this, these projects have to manually initialize
the submodules which is completely unnecessary.

Closes https://github.com/mesonbuild/meson/issues/1449
2017-03-25 06:47:04 +05:30
Jussi Pakkanen df1480fe11 Merge pull request #1456 from ieei/compute_int
Add compute_int, fixes #435
2017-03-23 16:02:40 -04:00
Thibault Saunier 4739d8763c interpretter: Use a namedtuple for the ModuleState 2017-03-20 18:47:46 -04:00
Haakon Sporsheim c9fe3a3ad4 compiler: Ensure prefix and dependencies are used for alignment.
This is now similar to how prefix and dependencies are used in all
the other similar checks performed by the compiler.
2017-03-10 12:33:21 +01:00
Haakon Sporsheim 1e2c914b3c compiler: Fix compute_int and sizeof for cross compilation.
sizeof now uses compute_int which again binary searches for correct value.
2017-03-10 12:33:21 +01:00
Haakon Sporsheim 52f23f8c34 compiler: Add compute_int functionality.
Fixes #435
2017-03-09 14:31:38 +01:00
Jussi Pakkanen d6614ba811 Merge pull request #1402 from centricular/test-setup-fixes
Various fixes to how mesontest handles test setups.
2017-02-20 14:56:45 -05:00
Jussi Pakkanen 98af711ca6 Merge pull request #1403 from centricular/compile_resources
Make configure_file() great again
2017-02-20 14:27:06 -05:00
Nirbheek Chauhan cb0aa6a83a configure_file: Substitute @INPUT@/@OUTPUT@/etc in command
The same substitutions and rules as custom_target().

Also generally fix it to actually work when run in a subdir and with
anything other than absolute paths for input and output files.

We now also log a message when configuring files.

Includes tests for all this.
2017-02-20 23:32:04 +05:30
Nirbheek Chauhan af1b898cc5 configure_file: Don't allow both command and configuration kwargs 2017-02-20 23:32:03 +05:30
Nirbheek Chauhan d1bc5c3404 add_test_setup: Treat no env as empty env
Otherwise env is {} and we get a traceback trying to use the setup:

$ /home/cassidy/dev/meson/mesontest.py -C build --setup valgrind
ninja: Entering directory `/home/cassidy/dev/gst/master/gst-build/build'
ninja: no work to do.
Traceback (most recent call last):
  File "/home/cassidy/dev/meson/mesontest.py", line 579, in <module>
    sys.exit(run(sys.argv[1:]))
  File "/home/cassidy/dev/meson/mesontest.py", line 575, in run
    return th.doit()
  File "/home/cassidy/dev/meson/mesontest.py", line 337, in doit
    self.run_tests(tests)
  File "/home/cassidy/dev/meson/mesontest.py", line 485, in run_tests
    self.drain_futures(futures, logfile, jsonlogfile)
  File "/home/cassidy/dev/meson/mesontest.py", line 504, in drain_futures
    self.print_stats(numlen, tests, name, result.result(), i, logfile, jsonlogfile)
  File "/usr/lib64/python3.5/concurrent/futures/_base.py", line 398, in result
    return self.__get_result()
  File "/usr/lib64/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
  File "/usr/lib64/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/cassidy/dev/meson/mesontest.py", line 216, in run_single_test
    child_env.update(self.options.global_env.get_env(child_env))
AttributeError: 'dict' object has no attribute 'get_env'

There is no harm in doing this, and this is the simplest fix for this.

Closes https://github.com/mesonbuild/meson/issues/1371
2017-02-19 23:13:32 +05:30
Nirbheek Chauhan f1fe823763 Add repr() for EnvironmentVariables{,Holder}
Makes it easier to debug issues with it
2017-02-19 23:13:32 +05:30
Nirbheek Chauhan f23a4a8b27 run_command: Fix error message on incorrect argument
Be more descriptive so people know what they can do.
2017-02-19 03:53:21 +05:30
Nirbheek Chauhan 2478bb144d rpm: We no longer provide the full path to a library
Ever since we changed how we do library searching, the full path to the
library has not been available under `.fullpath`. This has been broken
for at least a year...
2017-02-19 03:50:43 +05:30
Nirbheek Chauhan 7e805a019a find_program: Fix implementation of .path()
And actually test that prog.path() works. The earlier test was just
running the command without checking if it succeeded.

Also make everything use prog.get_command() or get_path() instead of
accessing the internal member prog.fullpath directly.
2017-02-19 03:49:31 +05:30
Nirbheek Chauhan 280346da3a find_program: Support passing mesonlib.File objects
This means you can pass files() and the return value of configure_file()
to find_program() now.
2017-02-19 03:01:24 +05:30
Jussi Pakkanen 5ee92d5bb0 Prohibit absolute paths in subdir(). 2017-02-17 15:45:38 -05:00
Jussi Pakkanen 28353e10e1 Prohibit manually built paths that point in srcdir in include_directories and give information on what to use instead. 2017-02-17 15:42:53 -05:00
Jussi Pakkanen 87632fa51e Merge pull request #1368 from dimkr/subproject_defaults
Bug fix - KeyError on subproject without default options
2017-02-09 23:02:47 +02:00
Nirbheek Chauhan 781e69094a dependencies: Distinguish native/cross while caching
Closes https://github.com/mesonbuild/meson/issues/1366
2017-02-07 20:55:24 +02:00
Dima Krasner 65029f4114 Bug fix - KeyError on subproject without default options 2017-02-07 09:42:55 +02:00
Nirbheek Chauhan 7d6f628ed4 Support file perms for install_data and install_subdir
With the 'install_mode' kwarg, you can now specify the file and
directory permissions and the owner and the group to be used while
installing. You can pass either:

* A single string specifying just the permissions
* A list of strings with:
  - The first argument a string of permissions
  - The second argument a string specifying the owner or
    an int specifying the uid
  - The third argument a string specifying the group or
    an int specifying the gid

Specifying `false` as any of the arguments skips setting that one.

The format of the permissions kwarg is the same as the symbolic
notation used by ls -l with the first character that specifies 'd',
'-', 'c', etc for the file type omitted since that is always obvious
from the context.

Includes unit tests for the same. Sadly these only run on Linux right
now, but we want them to run on all platforms. We do set the mode in the
integration tests for all platforms but we don't check if they were
actually set correctly.
2017-01-24 00:20:51 +05:30
Mike Sinkovsky 969be1f679 cleanup: Remove redundant parentheses 2017-01-18 21:22:47 +02:00
Mike Sinkovsky 1d177fb127 cleanup: Unused local variables 2017-01-18 21:22:47 +02:00
Jussi Pakkanen 11f9425a5e Can use targets directly in test arguments. 2017-01-15 21:54:26 +02:00
Hemmo Nieminen b90956c2f2 mesontest: Improve test suite selection.
Suite option can now be given to specify in more detail which tests should
be run.
2017-01-12 22:17:12 +02:00
Mike Sinkovsky 5b626ab4cb style: [E1**] Indentation 2017-01-11 12:33:27 -05:00
Mike Sinkovsky 77515ee541 style: [E303] too many blank lines (2) 2017-01-11 12:33:27 -05:00
Mike Sinkovsky c8981bdd1b style: [E711] comparison to None should be 'if cond is None:' 2017-01-11 12:33:27 -05:00
Mike Sinkovsky e9a891fe25 style: [E502] the backslash is redundant between brackets 2017-01-11 12:33:27 -05:00
Jussi Pakkanen 6ac9a8e738 Add .find_python() method. Supersedes #777. 2017-01-09 21:23:18 +02:00
Jussi Pakkanen fbabe8ad85 There are two different kinds of extensions: modules that create new
objects directly and snippets that just call into interpreter methods.
2017-01-09 21:11:48 +02:00
Jussi Pakkanen 24221d71cc Created a Python 3 module for simpler building of Python extension modules. 2017-01-09 21:07:23 +02:00
Jussi Pakkanen 9cf0991a1d Merge pull request #1278 from mesonbuild/newmodules
Bring some order to modules
2017-01-09 14:03:15 -05:00
Jussi Pakkanen 340781c515 Fix Gnome module. 2017-01-09 20:04:52 +02:00
Jussi Pakkanen 00f62d0755 Can get values in ConfigurationData objects. 2017-01-06 14:01:45 -05:00
Jussi Pakkanen 570c9b150b Fix a few more modules. 2017-01-06 19:22:56 +02:00
Jussi Pakkanen de24fddbd1 Create a module return value object. 2017-01-04 21:01:06 +02:00
Jussi Pakkanen 55cdba635e Merge pull request #1260 from mesonbuild/subproj_defaults
Can set subproject option defaults from command line and master project
2017-01-03 16:03:18 -05:00
Mike Sinkovsky 079e43f70b fix 'unreachable code' warnings 2017-01-03 13:34:39 -05:00
Jussi Pakkanen b3d51abff2 Can put external programs to test suite exe wrappers directly. 2017-01-02 23:52:50 +02:00
Jussi Pakkanen 74f15263b6 Can set envvars in test setups. 2017-01-02 23:52:50 +02:00
Jussi Pakkanen ee8a6e6fc5 Can specify test setups and run them with mesontest. 2017-01-02 23:52:50 +02:00
Jussi Pakkanen d94f64ded1 Support default_options in dependency() fallbacks. 2017-01-02 18:58:05 +02:00
Igor Gnatenko 969dc7e995 style: fix E124 violations
E124: closing bracket does not match visual indentation

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko 116da33cdd style: fix E128 violations
E128: continuation line under-indented for visual indent

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Jussi Pakkanen b55235dfbd Fix space before :. 2016-12-31 16:28:15 +02:00
Jussi Pakkanen d716d53b32 Can override project option default values in subproject(). 2016-12-29 20:34:13 +02:00
Jussi Pakkanen 73042c7912 Can set project options (but not global options) in subproject default options. 2016-12-29 19:30:58 +02:00
Jussi Pakkanen f85c348b94 Move option file parsing to after the project() inputs have been decoded to access default options. 2016-12-29 18:36:34 +02:00
Jussi Pakkanen 775729eb59 Can specify include directories to compiler tests. 2016-12-23 20:47:39 +02:00
Elliott Sales de Andrade 18c38df875 Add Generator.process_files to reduce code duplication. 2016-12-22 17:08:32 +02:00
Jussi Pakkanen a2528a8816 Merge pull request #1233 from mesonbuild/wip/ignatenko/code-style
Trivial cleanups in code
2016-12-21 00:09:44 +02:00
Nirbheek Chauhan 589a56e78f Cache the scripts used for postconf and install phases
Cache the absolute dir that the script is searched in and the name of
the script. These are the only two things that change.

Update the test to test for both #1235 and the case when a script of the
same name is in a different directory (which also covers the subproject
case).

Closes #1235
2016-12-20 00:09:02 +02:00
Nirbheek Chauhan 9bc07a0941 Fix several more lint errors
Found by Igor Gnatenko

************* Module mesonbuild.interpreter
E:1232,33: No value for argument 'interp' in constructor call (no-value-for-parameter)
************* Module mesonbuild.dependencies
E: 68, 4: An attribute defined in mesonbuild.dependencies line 39 hides this method (method-hidden)
************* Module mesonbuild.environment
E: 26, 0: class already defined line 19 (function-redefined)
E: 68,18: Undefined variable 'InterpreterException' (undefined-variable)
E:641,39: Undefined variable 'want_cross' (undefined-variable)
E:850,94: Undefined variable 'varname' (undefined-variable)
E:854,94: Undefined variable 'varname' (undefined-variable)
E:860,102: Undefined variable 'varname' (undefined-variable)
E:863,94: Undefined variable 'varname' (undefined-variable)
************* Module mesonbuild.modules.gnome
E:438,26: Undefined variable 'compilers' (undefined-variable)
2016-12-20 00:07:00 +02:00
Igor Gnatenko 139e020ede tree-wide: use proper 'not in' notation
Let's be more pythonic and 'not is' seems really weird.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 21:48:35 +01:00
Igor Gnatenko 28d4d57756 interpreter: remove duplicated dictionary key
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 18:33:52 +01:00
Igor Gnatenko 8268eb4959 tree-wide: remove unused imports
./setup.py:17:1: F401 'os' imported but unused
import os
^
./setup.py:37:1: F401 'stat.ST_MODE' imported but unused
from stat import ST_MODE
^
./run_tests.py:17:1: F401 'os' imported but unused
import subprocess, sys, os
^
./run_tests.py:18:1: F401 'shutil' imported but unused
import shutil
^
./run_unittests.py:23:1: F401 'mesonbuild.dependencies.Qt5Dependency' imported but unused
from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency
^
./mesonbuild/build.py:15:1: F401 '.coredata' imported but unused
from . import coredata
^
./mesonbuild/interpreter.py:32:1: F401 'subprocess' imported but unused
import os, sys, subprocess, shutil, uuid, re
^
./mesonbuild/interpreter.py:32:1: F401 're' imported but unused
import os, sys, subprocess, shutil, uuid, re
^
./mesonbuild/dependencies.py:23:1: F401 'subprocess' imported but unused
import os, stat, glob, subprocess, shutil
^
./mesonbuild/mesonlib.py:17:1: F401 'sys' imported but unused
import platform, subprocess, operator, os, shutil, re, sys
^
./mesonbuild/modules/qt5.py:15:1: F401 'subprocess' imported but unused
import os, subprocess
^
./mesonbuild/modules/pkgconfig.py:15:1: F401 '..coredata' imported but unused
from .. import coredata, build
^
./mesonbuild/scripts/scanbuild.py:15:1: F401 'sys' imported but unused
import sys, os
^
./mesonbuild/scripts/meson_exe.py:20:1: F401 'subprocess' imported but unused
import subprocess
^
./mesonbuild/scripts/meson_exe.py:22:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/symbolextractor.py:23:1: F401 'subprocess' imported but unused
import os, sys, subprocess
^
./mesonbuild/scripts/symbolextractor.py:25:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/meson_install.py:19:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/yelphelper.py:15:1: F401 'sys' imported but unused
import sys, os
^
./mesonbuild/scripts/yelphelper.py:20:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException
^
./mesonbuild/backend/vs2010backend.py:17:1: F401 're' imported but unused
import re
^
./test cases/vala/8 generated sources/src/copy_file.py:3:1: F401 'os' imported but unused
import os
^
./test cases/common/107 postconf/postconf.py:3:1: F401 'sys' imported but unused
import sys, os
^
./test cases/common/129 object only target/obj_generator.py:5:1: F401 'shutil' imported but unused
import sys, shutil, subprocess
^
./test cases/common/57 custom target chain/usetarget/subcomp.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/95 dep fallback/subprojects/boblib/genbob.py:3:1: F401 'os' imported but unused
import os
^
./test cases/common/98 gen extra/srcgen.py:4:1: F401 'os' imported but unused
import os
^
./test cases/common/113 generatorcustom/gen.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/113 generatorcustom/catter.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/59 object generator/obj_generator.py:5:1: F401 'shutil' imported but unused
import sys, shutil, subprocess
^

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 18:19:35 +01:00
Igor Gnatenko 3b55f6de8c s/Nonexistant/Nonexistent/g
There is basically no such word in english, "nonexistant".
American people use "nonexistent" and British people used
to have "non-existent", but some time ago they did away with
the hyphens, so there is only one option really: "nonexistent".

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18 18:32:17 +02:00
Nirbheek Chauhan c693bd9bb4 Allow passing arguments to install scripts
Closes #1213
2016-12-18 18:30:47 +02:00
Jussi Pakkanen b389f43060 Revert "Merge pull request #1145 from AlexandreFoley/wrap-fix"
This reverts commit 541dd92ef7, reversing
changes made to 155617e539.
2016-12-15 22:33:25 +02:00
Jussi Pakkanen de83e94b5a Merge pull request #1171 from centricular/fix-extracted-generated-prebuilt-object-targets-linking
Several fixes to how we handle objects in build targets
2016-12-13 12:22:11 +02:00
Jussi Pakkanen 07679f0330 Merge pull request #1184 from centricular/cc.prefixes_underscore
Add a new compiler function 'symbols_have_underscore_prefix'
2016-12-13 12:21:50 +02:00
Nirbheek Chauhan 7b3d00fee4 Use dict for self.build.compilers instead of list
Everywhere we use this object, we end up iterating over it and comparing
compiler.get_language() with something. Using a dict is the obvious
choice and simplifies a lot of code.
2016-12-13 09:20:34 +05:30
Nirbheek Chauhan 09f65b7a3c New compiler function 'symbols_have_underscore_prefix'
Check if the compiler prefixes an underscore to global symbols. This is
useful when linking to compiled assembly code, or other code that does
not have its C symbol mangling handled transparently by the compiler.

C symbol mangling is platform and architecture dependent, and a helper
function is needed to detect it. Eg: Windows 32-bit prefixes underscore,
but 64-bit does not. Linux does not prefix an underscore but OS X does.
2016-12-13 09:17:06 +05:30
Elliott Sales de Andrade ec47db6c0c Add Compiler.has_multi_arguments method.
It allows checking if a compiler supports a multi-argument option.
2016-12-12 23:34:03 +02:00
Nirbheek Chauhan 60716fcd6d Use universal_newlines=True for all Popen calls
Instead of adding it everywhere manually, create a wrapper called
mesonlib.Popen_safe and use that everywhere that we call an executable
and extract its output.

This will also allow us to tweak it to do more/different things if
needed for some locales and/or systems.

Closes #1079
2016-12-11 01:59:58 +02:00
Jussi Pakkanen f62f730821 Merge pull request #1126 from mesonbuild/sharedmodule
Support for shared modules
2016-12-07 21:49:16 +02:00
Jussi Pakkanen dc1f537fb3 Skip shared module test on VS because it fails for some reason nobody understands. 2016-12-07 00:30:28 +02:00
Nirbheek Chauhan b9a7c0cf39 misc: Use relative imports everywhere
Using 'mesonbuild' as the module can cause it to use the
system-installed module and can also break if we rename the directory,
so avoid that by always using relative imports.
2016-12-07 00:24:17 +05:30
Nirbheek Chauhan 7b8f41ce31 Compiler checks can only accept external dependencies
This is already how it should've been, but:

a) The test for this was wrong since Dependency is a base class for all
dependencies and isinstance on an InternalDependency will also be true
b) Internal dependencies can't ever be used here anyway because compiler
checks are always run at configure time and internal dependencies are
only built after that.
2016-12-07 00:08:16 +05:30
Jussi Pakkanen 541dd92ef7 Merge pull request #1145 from AlexandreFoley/wrap-fix
build regeneration can update wrap-git and wrap-hg in some cases.
2016-12-06 20:31:24 +02:00
Jussi Pakkanen b28da68faf Expose project information with mesonintrospect. Closes #1118. 2016-12-06 20:27:59 +02:00
Nirbheek Chauhan c7a2664cb7 Better error when passing invalid objects to install_header
This will print the object type when you pass a generated file to
install_header instead of printing an assert.
2016-12-06 20:27:33 +02:00
Jussi Pakkanen 228a9035af Merge pull request #1103 from mesonbuild/rewriter
Beginnings of a rewriter
2016-12-06 20:22:04 +02:00
Alexandre Foley 228adaa287 Wrap.py: Made it so using an already downloaded subproject is only for the wrap-file case. Git and Mercurial can update the repository if it the wrap is one.
Also did a bit of cleanup.
interpreter.py: There’s a catch all except clause at the line 1928, it didn’t give the user any information whatsoever about the exception it caught. Now it at least print it to the log as a warning.
2016-12-05 17:25:36 -05:00
Jussi Pakkanen 14ca7d602c Store subdir information for each node so we can remove files set in other subdirectories. 2016-12-04 18:28:25 +02:00
Nirbheek Chauhan e1c9d94708 Allow many version conditions for pkg-config deps
Sometimes we want to restrict the acceptable versions to a list of
versions, or a smallest-version + largest-version, or both. For
instance, GStreamer's opencv plugin is only compatible with
3.1.0 >= opencv >= 2.3.0
2016-12-03 21:46:20 +02:00
Jussi Pakkanen 6d84b9b646 Created new shared module build target type, and make sure -Wl,--no-undefined is not used when linking it. 2016-12-02 21:55:56 +02:00
Jussi Pakkanen 7e1b674704 Add both native and cross compiler options to option list. 2016-11-26 11:24:20 -05:00
Jussi Pakkanen 0250b2cce6 Can give many alternative names to find_program to simplify searching. 2016-11-20 16:54:19 -05:00
Jussi Pakkanen 8f41154827 Can specify headers to install with Files. 2016-11-20 16:52:45 -05:00
Jussi Pakkanen aa9668a2fc Merge pull request #730 from mesonbuild/newtest
New testing tool
2016-11-20 16:07:32 -05:00
Jussi Pakkanen c41805f012 Moved more stuff, can now parse all of common tests. 2016-11-19 22:11:20 +02:00
Jussi Pakkanen 7e8872236d Implement a bunch of functions. 2016-11-19 21:25:28 +02:00
Jussi Pakkanen 5b00c9b9c0 Dead code removal. 2016-11-19 19:34:49 +01:00
Jussi Pakkanen 7ed7219d9d Moved functions to base enough to get the base sample project parsed. 2016-11-19 20:18:30 +02:00
Jussi Pakkanen 0a31afd672 Embark on a journey to create a rewrite tool. 2016-11-19 19:48:12 +02:00
Jussi Pakkanen a01919976e Always specify installed data with a File object. Closes #858. 2016-11-18 17:37:35 -05:00
Jussi Pakkanen 951262d759 Removed Valgrind from core. 2016-11-18 22:04:29 +02:00
Jussi Pakkanen 621219ccb0 Removed duplicate log message for command running. Closes #1056. 2016-11-17 00:20:36 +02:00
Thibault Saunier 85a0cd7635 Add new add_project_[link]_args functions
Fixes 979
2016-11-12 17:34:06 -05:00
Nirbheek Chauhan 085650a1e3 vala: Implement valac.find_library
Move CCompiler.compile to Compiler.compile so that ValaCompiler can use
it. Also rewrite ValaCompiler.sanity_check to use it since it does
a simple compile check.

At the same time, it enhances ExternalLibrary to support arguments for
languages other than C-like.

Includes a test for this that links against zlib through Vala.

Closes #983
2016-11-12 13:56:17 -05:00
Jussi Pakkanen 1d9c40c9c3 Merge pull request #1027 from centricular/has-header-prefix
cc.has_header: Allow specifying a prefix for headers
2016-11-12 12:16:16 -05:00
Jussi Pakkanen 434bb03743 Merge pull request #997 from tp-m/copy-mutable-variables-on-assignment
Copy mutable variables on assignment (configuration_data and environment)
2016-11-12 11:35:57 -05:00
Nirbheek Chauhan aa5afba00b cc.has_header: Allow specifying a prefix for headers
Fixes #1026
2016-11-11 10:25:34 +05:30
alvarez86 87f07cdf3d Minor adjusts (#1001)
* contributing: Use should instead of thould

* interpreter: Use exist_ok parameter in subdir function

We explicitly depend on python 3.4 or newer, which means the exist_ok
parameter is available. Use it instead of a try with a pass on except.

* authors: Add my name at the end of authors file
2016-11-07 11:26:46 -08:00
Jussi Pakkanen 335d263315 Merge pull request #942 from mesonbuild/tingping/private-methods
Don't expose private module methods
2016-11-06 09:13:39 -08:00
Jussi Pakkanen f8bf37979b Merge pull request #993 from centricular/cached-dep-required-attr
dependency: Check that cached_dep has the 'required' attribute
2016-11-06 09:11:42 -08:00
Patrick Griffis 1811f83e2a Don't expose module functions prefixed with _
This is the common Python convention for private methods
so lets not expose these to build files as they are
implementation details and their behavior is undefined.
2016-11-06 00:01:36 -04:00
Tim-Philipp Müller 627d859809 interpreter: copy mutable variables on assignment
All assignments in meson should be by value, so mutable objects
(i.e. environment() and configuration_data()) should be copied
automatically on assignment.

Fixes #831.
2016-11-05 16:56:02 +00:00
Tim-Philipp Müller 5898fb094c Revert "interpreter: Add a way to copy and environment object"
This reverts commit fcaf319e49.

This should be done automatically on assignment, see #831
2016-11-05 12:10:25 +00:00
Nirbheek Chauhan fd260eac81 Don't ignore invalid code related to subproject calls
We should only silently return from a dependency() call if the error is
transient (old version, wrap failed to download etc), not if the
subproject invocation or dependency name are incorrect.

For instance, if you use a dependency(..., fallback : ...) call in
a meson.build not in the root directory, we would always ignore the
call instead of erroring out due to invalid usage.

We should consider categorising our exceptions in this manner elsewhere
too.
2016-11-05 03:17:27 +05:30
Nirbheek Chauhan 268f737612 dependency: Check that cached_dep has the 'required' attribute
Closes https://github.com/mesonbuild/meson/issues/992
2016-11-04 14:21:52 +05:30
Scott D Phillips 3650669874 Allow subproject declarations in subdirectories 2016-11-02 13:52:04 -07:00
Tim-Philipp Müller aeaccdc418 Fix dependency() ignoring required attribute when checked second or third time
If first checking for a dependency as not-required, and then later
checking for the same dependency again as required, we would not
error out saying the dependency is missing, but just silently
re-use the cached dependency object from the first check and then
likely fail at build time if the dependency is not actually there.

With test case.

Fixes #964.
2016-11-02 13:49:57 -07:00
Jussi Pakkanen 36a0d162cb Merge pull request #895 from mesonbuild/wip/tingping/gnome-vapi
gnome: Add generate_vapi function
2016-11-02 11:41:58 -07:00
Nirbheek Chauhan 3df75d696d Directly pass the compiler to get_args_from_envvars
Seems better to do this since the behaviour is compiler-specific. Would
be easier to extend this later too in case we want to do more
compiler-specific things.
2016-10-26 23:16:05 +05:30
Nirbheek Chauhan 70265c3782 Improve error when using the dependencies kwarg
The error message is misleading (talks about external dependencies), and
doesn't tell you what you need to do (use the output of
declare_dependency, dependency, or find_library). At the same time
rename add_external_deps to add_deps since it adds internal deps too.

Plus many more error message improvements all over the place.
2016-10-23 18:02:19 +05:30
Patrick Griffis bae7d7b3d7 gnome: Add generate_vapi() function
This allows C projects to generate vapi bindings from
gir files and returns a dependency that can be used by
Vala.
2016-10-21 02:23:54 -04:00
Nirbheek Chauhan 57ce7d4618 Add support for extracting objects in unity builds
Not only does extract_all_objects() now work properly again,
extract_objects() also works if you specify a subset of sources all of
which have been compiled into a single unified object.

So, for instance, this allows you to extract all the objects
corresponding to the C sources compiled into a target consisting of
C and C++ sources.
2016-10-21 08:00:39 +05:30
Jussi Pakkanen e908910187 Can query pkg-config variables from the system. Closes #726. 2016-10-19 22:36:34 +03:00
Jussi Pakkanen 24552819b4 Force dep versions into the version kwarg. 2016-10-19 01:03:29 +03:00
Scott D Phillips 08aeac22a9 Don't raise exception when a fallback dependency is not found
If a fallback dependency is not found just return None.  The
caller can then raise the exception it already has if
required=True, or just continue on if required=False.
2016-10-17 19:32:09 +03:00
Thibault Saunier 77b379f5cf Try using already setup fallback subprojects before using native dependency
In the case the main project set a subproject for a dependency another
subprojects uses, that other subproject should rather use the first
subproject rather that using native dependency.

For example in gst-all we set all GStreamer modules as subprojects
and, gst-plugins-base is set after gstreamer core, and
we want gst-plugins-base to always use GStreamer core from the subproject
and not the possibly avalaible native one.
2016-10-14 11:25:16 +02:00
Thibault Saunier fcaf319e49 interpreter: Add a way to copy and environment object
It is really usefull when you have common variables defined
for all tests and then need to set some extra ones for each test
2016-10-14 11:25:16 +02:00