Commit Graph

333 Commits

Author SHA1 Message Date
Daniel Mensinger 4bf1a352cc mconf: Fixed crash for variables in targets (closes #4960) 2019-02-26 18:40:45 +02:00
Dylan Baker b5d847e38c allow paths to be set in the cross file
Just like the previous patch, but for cross files

Fixes #1433
2019-02-11 12:50:32 -08:00
Dylan Baker 5b896ed70b allow setting directory locations in a native file
This allows the person running configure (either a developer, user, or
distro maintainer) to keep a configuration of where various kinds of
files should end up.
2019-02-11 12:50:32 -08:00
Simon McVittie 65f3de70ac tests: Don't return an undefined value from main()
This caused test failures while backporting meson to an old runtime
environment.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-17 20:52:06 +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 815f1205a8 do_subproject: Improve log messages and formatting 2019-01-16 11:16:46 -05:00
Daniel Mensinger b11df88395
Documentation and unit test update 2019-01-06 12:19:29 +01:00
Daniel Mensinger b91c5aad85
Update intro dump on meson configure 2019-01-06 12:19:29 +01:00
Daniel Mensinger c4eb5c79fe
Added unit test 2019-01-06 12:19:28 +01:00
Daniel Mensinger e5099357c2
Tests and docs 2018-12-29 23:56:21 +01:00
Jussi Pakkanen 1fca654055 Add a clang-format target. 2018-12-30 00:50:00 +02:00
Niklas Haas 261ab9b214 pkgconfig: Fix link order of library dependencies
Since `_process_libs` appends the lib's dependencies this list already,
the final return value of `_process_libs` will end up after its
dependencies, which is the wrong way around. (The lib must come first,
then its dependencies)

The easiest solution is to simply pre-pend the return value of
`_process_libs` rather than appending it, so that its dependencies come
after the library itself.

Closes #4091.
2018-12-12 10:42:32 -05:00
Jussi Pakkanen c44a5a1aec Deduplicate export-dynamic and pthread. Closes #4567. 2018-12-06 16:20:54 +02:00
Marcel Hollerbach 443a4a8c78 pkgconfig: add support for pkgconfig generation for c#
this adds support for generating pkgconfig files for c#.

The difference to c and cpp is that the -I flag is not known to the c#
compiler, but rather the -r flag which is used to link a .dll file into
the compiled library.

However this opens the question of validating which pkgconfig files can
be generated (depending on the language).

This implements 4409.
2018-11-21 21:36:39 +02:00
Dylan Baker 71a5f990d0 modules/python: Allow use of the native file
Currently this just allows setting a "python" variable that always
overrides, probably we want to have the option for "python2" and
"python3" as well.
2018-11-14 15:57:37 -08:00
Dylan Baker 091452f8cd modules/python3: allow specifying in the native file 2018-11-14 15:57:37 -08:00
Dylan Baker caf1066cd1 dependencies: Allow config tool dependencies to use native files
This allows tools like llvm-config to be selected from the config file

Fixes: #3327
2018-11-14 15:57:37 -08:00
Dylan Baker 42ddc30cfe interpreter: allow find_program to use the native file 2018-11-14 15:57:37 -08:00
Dylan Baker cb2a66cdef unittests: Add framework for testing native config files 2018-11-14 15:57:37 -08:00
Stian Selnes 0821462ce3 Add kwarg is_default to add_test_setup()
is_default may be used to set the name of the test setup that will be
used by default whenever the option --setup is not given.

Fixes #4430
2018-11-12 16:23:59 +05:30
Xavier Claessens a173dbf772 Add reconfigure/wipe unit test 2018-11-06 16:37:50 -05:00
Lyude Paul 11e3011a6b Don't use host pkg-config for native dependencies
When trying to cross-compile mesa on an aarch64 system, I noticed some
strange behavior. Meson would only ever find the wayland-scanner binary
in my host machine's sysroot (/mnt/amethyst):

  Native dependency wayland-scanner found: YES 1.16.0
  Program /mnt/amethyst/usr/bin/wayland-scanner found: YES (/mnt/amethyst/usr/bin/wayland-scanner)

It should be finding /usr/bin/wayland-scanner instead, since the
wayland-scanner dependency is created as native. On closer inspection,
it turned out that meson was ignoring the native argument passed to
dependency(), and wuld always use the pkgconfig binary specified in my
toolchain instead of the native one (/usr/bin/pkg-config):

  Native dependency wayland-scanner found: YES 1.16.0
  Called `/home/lyudess/Projects/panfrost/scripts/amethyst-pkg-config
  --variable=wayland_scanner wayland-scanner` -> 0

Turns out that if we create a dependency() object with native:false, we
end up caching the pkg-config path for the host machine in
PkgConfigDependency.class_pkgbin, instead of the build machine's
pkg-config path. This results causing in all pkg-config invocations for
dependency() objects to use the host machine's pkg-config binary,
regardless of whether or not 'native: true' was specified when the
dependency() object was instantiated.

So, fix this by never setting PkgConfigDependency.class_pkgbin for cross
dependency() objects. Also, add some test cases for this. Since
triggering this bug can be avoided by creating a dependency() objects
with native:true before creating any with native:false, we make sure
that our test has two modes: one where it starts with a native
dependency first, and another where it starts with a cross dependency
first.

As a final note here: We currently skip this test on windows, because
windows doesn't support directly executing python scripts as
executables: something that we need in order to point pkgconfig to a
wrapper script that sets the PKG_CONFIG_LIBDIR env appropriately before
calling pkg-config.

Signed-off-by: Lyude Paul <thatslyude@gmail.com>
2018-11-06 21:12:10 +02:00
Jussi Pakkanen c4a9f59dc4 Move VS C++17 test to a unit test since it requires env setup. 2018-10-24 17:19:36 +03:00
Jan Tojnar c0c075c129 Make custom dist scripts accept arguments.
meson.add_dist_script, introduced in #3906, did not accept any arguments
other than script name. Since all other meson.add_*_script methods
do accept args, this makes the dist script accept them as well.
2018-10-04 21:20:57 +03:00
David Seifert 8f16d0f3c9 Fix ICC on macOS 2018-09-16 18:27:19 +03:00
Xavier Claessens 3cf03ec6d6 find_installation: Add support for feature option in required kwarg
Closes: #4165.
2018-09-16 15:07:43 +03:00
Jussi Pakkanen f2041405fb
Merge pull request #4017 from jon-turney/version-comparison-rewrite
Use rpmvercmp version comparison
2018-09-13 22:19:35 +03:00
Jon Turney de7c3cbbc5 Fix flake8 'imported but unused' reports
$ flake8 | grep F401
./mesonbuild/compilers/d.py:19:1: F401 '.compilers.GCC_CYGWIN' imported but unused
./test cases/unit/35 dist script/replacer.py:3:1: F401 'sys' imported but unused
2018-09-13 20:33:17 +03:00
Jon Turney 1394cb9263 Correct version_compare_condition_with_min()
Correct version_compare_condition_with_min() for the case where no minimum
version is established by the version constraint.  Add a simple test.

Also fix test_feature_check_usage_subprojects by escaping regex
metacharacters.

if |condition| is '<', '<=' or '!=', the minimum version satisfying the
condition is 0, so the minimum version for a feature is never met.

if |condition| is '>=' or '==', the minimum version satisfying the condition
is the version compared with, so the minimum version for a feature must be
less than or equal to that.

if |condition| is '>', the minimum version satisfying the condition is
greater than the version compared with, so the minimum version for a feature
must be less than that

(it's this last condition that makes this function necessary, as in all
other cases we could establish a definite minimum version which we could
compare to see if it's less than or equal to the current version)
2018-09-12 15:38:00 +01:00
Jussi Pakkanen 68f669bd2b Condense test dirs. 2018-09-06 19:09:35 +03:00
Jussi Pakkanen fb770e1e3d Add support for custom dist scripts. 2018-08-27 23:35:29 +03:00
Nirbheek Chauhan 5e93393cd9 Test that system shlibs with undefined symbols can be found 2018-08-22 12:24:43 -07:00
Jussi Pakkanen 972535a6ac Condense test dirs. 2018-08-19 12:39:46 +03:00
Daniel Pirch 6ecd31af19 wraptool: fix manual selection of wrap file to promote
Fixed manually promoting wrap files with a full path, e.g.
`meson wrap promote subprojects/s1/subprojects/projname.wrap`,
which resulted in an error before (new test added:
`./run_unittests.py AllPlatformTests.test_subproject_promotion_wrap`).

Additionally, running promote with an invalid subproject path now fails
properly. Before, it just silently did nothing (added to test:
`./run_unittests.py AllPlatformTests.test_subproject_promotion`).
2018-08-17 00:33:38 +03:00
Jussi Pakkanen b400cbe058 Kill tabs dead! For good! 2018-08-15 22:28:42 +03:00
Jussi Pakkanen 867af1264f
Merge pull request #3945 from mesonbuild/dircondenser
Condense directory names with script.
2018-08-04 00:02:29 +03:00
Jussi Pakkanen e75f6e4305
Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacks
Be more permissive about not-found exe_wrapper
2018-07-31 19:33:06 +03:00
Jussi Pakkanen 17bfbb99e5 Condense test dirs. 2018-07-31 19:22:24 +03:00
Rafael Ávila de Espíndola 941d2c273a Move test from common to unit.
When I initially added the test the intention was to use it from
run_unittests.py only, but I placed it in the wrong directory.
2018-07-27 06:36:04 -07:00
Rafael Ávila de Espíndola c7360dd426 Make the rpath order deterministic. (#3932) 2018-07-25 19:40:54 +03:00
Nirbheek Chauhan e8dae2b966 cross: Be more permissive about not-found exe_wrapper
We used to immediately try to use whatever exe_wrapper was defined in
the cross file, but some people generate the cross file once and use
it for several projects, most of which do not even need an exe wrapper
to build.

Now we're a bit more resilient. We quietly fall back to using
non-exe-wrapper paths for compiler checks and skip the sanity check.
However, if some code needs the exe wrapper, f.ex., if you run a built
executable using custom_target() or run_target(), we will error out
during setup.

Tests will, of course, continue to error out when you run them if the
exe wrapper was not found. We don't want people's tests to silently
"pass" (aka skip) because of a bad CI setup.

Closes https://github.com/mesonbuild/meson/issues/3562

This commit also adds a test for the behaviour of exe_wrapper in these
cases, and refactors the unit tests a bit for it.
2018-07-09 05:39:40 +05:30
Nirbheek Chauhan a1d9adba09 FeatureNew: Make all checks subproject-specific
We now pass the current subproject to every FeatureNew and
FeatureDeprecated call. This requires a bunch of rework to:

1. Ensure that we have access to the subproject in the list of
   arguments when used as a decorator (see _get_callee_args).
2. Pass the subproject to .use() when it's called manually.
3. We also can't do feature checks for new features in
   meson_options.txt because that's parsed before we know the
   meson_version from project()
2018-07-02 19:52:53 +05:30
Nirbheek Chauhan ae8d044cb6 Allow command lists for find_program cross file overrides
This is accepted by all other binaries in the cross file. With this
change, we also don't check whether the specified command exists at
configure time, but that's probably a feature anyway.

Fixes https://github.com/mesonbuild/meson/issues/3737
2018-07-01 13:59:48 +00:00
Nirbheek Chauhan 2cbf7caf5c
Nirbheek/fix pkgconfig library dedup (#3813)
* Add a test case for bad de-dup of -framework args

https://github.com/mesonbuild/meson/issues/3800

* pkgconfig: Don't naively de-dup all arguments

Honestly don't know what I was smoking. Of course the `Libs:` field in
a pkg-config file can have arguments other than -l and -L

Closes https://github.com/mesonbuild/meson/issues/3800

* pkgconfig module: Fix needlessly aggressive de-dup
2018-07-01 12:31:31 +00:00
Nirbheek Chauhan 96b7fdb723 macos: Rewrite install_name for dependent built libraries on install
On macOS, we set the install_name for built libraries to
@rpath/libfoo.dylib, and when linking to the library, we set the RPATH
to its path in the build directory. This allows all built binaries to
be run as-is from the build directory (uninstalled).

However, on install, we have to strip all the RPATHs because they
point to the build directory, and we change the install_name of all
built libraries to the absolute path to the library. This causes the
install name in binaries to be out of date.

We now change that install name to point to the absolute path to each
built library after installation.

Fixes https://github.com/mesonbuild/meson/issues/3038
Fixes https://github.com/mesonbuild/meson/issues/3077

With this, the default workflow on macOS matches what everyone seems
to do, including Autotools and CMake. The next step is providing a way
for build files to override the install_name that is used after
installation for use with, f.ex., private libraries when combined with
the install_rpath: kwarg on targets.
2018-06-18 06:33:23 +00:00
Nirbheek Chauhan 5467eed186 Test that binaries that use external libraries work
When we link to an external library either with find_library() without
any dirs:, or with dependency(), we should be able to run uninstalled
out of the box without having to set any environment variables or other
shenanigans.

This is especially important on macOS because only the system frameworks
directory is in the default runtime path, and all other frameworks and
libraries need to be found with RPATH or absolute path to the dylib.
2018-06-18 06:33:23 +00:00
Xavier Claessens 7c4736d27f Convert args.projectoptions into a dict
This simplifies a lot of code, and centralize "key=value" parsing in a
single place.

Unknown command line options becomes an hard error instead of
merely printing warning message. It has been warning it would become an
hard error for a while now. This has exceptions though, any
unknown option starting with "<lang>_" or "b_" are ignored because they
depend on which languages gets added and which compiler gets selected.
Also any option for unknown subproject are ignored because they depend
on which subproject actually gets built.

Also write more command line parsing tests. "19 bad command line
options" is removed because bad cmd line option became hard error and
it's covered with new tests in "30 command line".
2018-06-06 20:02:37 +00:00
Nirbheek Chauhan a00433fdbc configure_file: Add a new action 'copy'
This will copy the file to the build directory without trying to read
it or substitute values into it.

Also do this optimization if the configuration_data() object passed to
the `configuration:` kwarg is empty, and print a warning about it.

See also: https://github.com/mesonbuild/meson/issues/1542
2018-05-22 02:36:55 +05:30
Nirbheek Chauhan 9565293f16 test setups: Inherit env when using a test setup
Closes https://github.com/mesonbuild/meson/issues/3525
2018-05-10 12:30:47 +02:00
Nirbheek Chauhan 575ffec62e python module: Move tests to test cases/unit
The tests are only run via unit tests, so that's where they should be.
2018-05-03 18:56:34 +05:30
Nirbheek Chauhan badbfa125c pkgconfig: Don't expose internal libraries in .pc files
Libraries that have been linked with link_whole: are internal
implementation details and should never be exposed to the outside
world in either Libs: or Libs.private:

Closes https://github.com/mesonbuild/meson/issues/3509
2018-05-02 11:46:47 +00:00
Jussi Pakkanen 2b5766980b Keep separator spaces in pkg-config declarations. Closes #3479. 2018-05-02 11:46:47 +00:00
Xavier Claessens 6de68e5201 Passing --default-library=both should override project value
Looks like this has always been broken, had_argument_for() was checking
if we have --default_library instead of --default-library.
2018-04-27 11:19:12 -04:00
Xavier Claessens 570c108635 Fix --warnlevel being renamed to --warning-level in latest release 2018-04-27 11:09:14 -04:00
Jussi Pakkanen 9b0453d3e9
Merge pull request #3225 from filbranden/fixperms3
Introduce install_umask to determine permissions of files in install tree. Default it to 022
2018-04-26 23:14:00 +03:00
Dylan Baker b8f1b84733 Tests: Add some tests for mixing -Dfoo and --foo
These are at least some of the tests that really deserved to be written
for 78e37c4953, but I was lazy.
2018-04-25 20:59:27 +03:00
Nirbheek Chauhan fc5e8dfcda Don't fail on not-required not-found deps in forcefallback mode
This involves the creation of a new dummy NotFoundDependency.
2018-04-21 16:10:03 +03:00
Filipe Brandenburger 59b0fa9722 Add a unit test for install_umask.
This test copies a src tree using umask of 002, then runs the build and
install under umask 027. It ensures that the default install_umask of
022 is still applied to all files and directories in the install tree.
2018-04-18 11:44:54 -07:00
Nirbheek Chauhan ef81a013a5 cross: Add compiler cross_args after normal args
This way they override all other arguments. This matches the order of
link arguments too.

Note that this means -I flags will come in afterwards and not override
anything else, but this is correct since that's how toolchain paths
work normally too -- they are searched last.

Closes https://github.com/mesonbuild/meson/issues/3089
2018-04-15 22:29:49 +03:00
Jussi Pakkanen 86f725c1e5
Merge pull request #3115 from makise-homura/e2k-lcc-support
Support lcc compiler for e2k (Elbrus) architecture
2018-04-15 17:18:44 +03:00
Martin Hostettler aff597fb99 ninjabackend: Try to guess library dependencies for linker invocation.
The linkers currently do not support ninja compatible output of
dependencies used while linking. Try to guess which files will be used
while linking in python code and generate conservative dependencies to
ensure changes in linked libraries are detected.

This generates dependencies on the best match for static and shared
linking, but this should not be a problem, except for spurious
rebuilding when only one of them changes, which should not be a problem.

Also makes sure to ignore any libraries generated inside the build, to
keep the optimisation working where changes in a shared library only
cause relink if the symbols have changed as well.
2018-04-15 07:29:21 +00:00
Martin Hostettler 3f7c6cf3d6 Improve generation of pkg-config files for static only libraries.
Previously pkg-config files generated by the pkgconfig modules for static libraries
with dependencies could only be used in a dependencies with `static: true`.

This was caused by the dependencies only appearing in Libs.private even
if they are needed in the default linking mode. But a user of a
dependency should not have to know if the default linking mode is static
or dynamic; A dependency('somelib') call should always pull in all
needed pieces into the build.

Now for meson build static libraries passed via `libraries` to the generate
method automatically promote dependencies to public.
2018-04-14 23:43:29 +03:00
Mathieu Duponchelle 1105ba3afd [fixup]: rename test after rebase 2018-04-07 16:13:59 +02:00
Mathieu Duponchelle 1ad04bed96 [fixup]: export symbols explicitly 2018-04-07 16:12:28 +02:00
Mathieu Duponchelle ae460f94ce [fixup]: Add test 2018-04-06 23:48:48 +02:00
chitranjali cc6be2e43d Fixing flake8 2018-03-29 14:43:56 +05:30
chitranjali 34cb503c85 PR review changes closes #2865 2018-03-29 13:32:36 +05:30
chitranjali 83766313a7 fix2865 2018-03-29 13:26:32 +05:30
Aleksey Filippov 8b1e9a6f6a Enable b_ndebug on VisualStudioCCompiler 2018-03-23 21:10:04 +02:00
Aleksey Filippov 6910f604ed Disable b_ndebug tests on MSVC 2018-03-21 17:30:21 +00:00
Aleksey Filippov af0b569ced Add unittests for b_ndebug=if-release and buildtype interactions 2018-03-21 16:42:35 +00:00
makise-homura 86fa9b133d test_reconfigure switched to b_coverage from b_lto
This is due to some compilers (e.g. lcc) don't support LTO,
and therefore no b_lto meson option is available.
2018-03-21 16:45:22 +03:00
Jussi Pakkanen e984e1072b
Merge pull request #3251 from mesonbuild/fixpkgconfigdeps
Fix pkg-config dependencies leaking out (debbug 892956)
2018-03-19 23:43:35 +02:00
Jussi Pakkanen d532650b0d Add test for pkgconfig generation and usage.
This builds a project with pkg-config file, installs it and then
builds a second project that uses that dependency and runs the result.
2018-03-16 23:52:45 +02:00
Jussi Pakkanen 9ecb75670f
Merge pull request #3127 from bluetech/method-permitted-kwargs 2018-03-13 21:16:30 +02:00
Evgenii Shatokhin 19718a8d9c Allow passing a compiler object to run_command()
Sometimes it is needed to run the current compiler with specific options
not to compile a file but rather to obtain additional info. For example,
GCC has several -print-* options to query it about the paths to
different libraries and development files. One use case is to get the
location of development files for GCC plugins, which is not easily
obtainable by other means:

  gcc -print-file-name=plugin

For this purpose, it would be convenient if the compiler object returned
by meson.get_compiler(lang) could be used in run_command() directly.
This commit implements it.

Signed-off-by: Evgenii Shatokhin <eshatokhin@virtuozzo.com>
2018-03-06 21:07:16 +02:00
Hemmo Nieminen 473dc80701 Add some test setup selection tests. 2018-02-25 21:44:59 +02:00
Ran Benita 4d8e4654cb Warn if non-permitted keyword arguments are given to compiler methods
This can help future generations avoid mistakes like this:
edb1c66239

To avoid breaking builds, this is currently just an error. After
sufficient time has passed this can hopefully become a hard error,
similarly to the already-existing `permittedKwargs` warnings.
2018-02-23 04:35:15 +02:00
Nirbheek Chauhan 8842839bb4 pkgconfig deps: Warn when a static library isn't found
A hard error makes this feature useless in most cases since a static
library usually won't be found for every library, particularly system
libraries like -lm. Instead, warn so the user can provide the static
library if they wish.

This feature will be expanded and made more extensible and more usable
in the future.

Closes https://github.com/mesonbuild/meson/issues/2785
2018-02-20 19:26:51 +02:00
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
Hemmo Nieminen ff1146bc8c Fix subproject prefix handling when checking subproject option validity. 2018-02-16 00:09:47 +02:00
Jon Turney b78a01bced Add a test case for python exception exit status 2018-02-15 12:51:25 +00:00
Jussi Pakkanen 5e4538fe63 Add external dependencies to pc files only if found. Closes #2911. 2018-01-19 15:49:49 +02:00
Jussi Pakkanen 714ac85d22 Renamed test dir to avoid duplicated numbers. 2018-01-19 15:49:49 +02: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 bcc95d7dd7 Use location formatting in mlog.warning() for invalid kwarg warning
This already reports the location (in a slightly different format), but
using mlog.warning() will make it easier if we want to change the location
format in future.
2018-01-01 13:21:01 +00: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
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
Jon Turney dd1de073f4 Add a test case for location in duplicate kwarg warning 2017-12-30 20:08:35 +00: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
Nirbheek Chauhan 55abe16d5a unit tests: Test that relative install_rpath works correctly
We weren't testing this with C++, so the breakage was missed.

https://github.com/mesonbuild/meson/issues/2814
2017-12-26 03:23:26 +05:30
Dylan Baker e245e57865 Warn on unknown command line arguments
I have a tendency to typo things. Humans in general are bad at spotting
spelling mistakes, computers are not. This patches prints the bad
options and provides the generic meson "This will be a hard error
someday" message.
2017-12-19 10:10:40 -08:00
Jussi Pakkanen 164fb9a150 Also promote wrap files. 2017-12-17 21:19:22 +02:00
Jussi Pakkanen 46c071ea5c Add functionality to promote nested dependencies to top level. 2017-12-17 21:17:13 +02:00
Nirbheek Chauhan 390f0b8b52 dependencies: Convert /c/foo/bar paths to C:/foo/bar
MSVC cannot handle MinGW-esque /c/foo paths, convert them to C:/foo.
We cannot resolve other paths starting with / like /home/foo so leave
them as-is so the user gets an error/warning from the compiler/linker.

These paths are commonly found in pkg-config files generated using
Autotools inside MinGW/MSYS and MinGW/MSYS2 environments.

Currently this is only done for PkgConfigDependency.
2017-12-03 10:06:11 +05:30
Dylan Baker c9351ce30c Add new array type option
This exposes the already existing UserStringArrayOption class through
the meson_options.txt. The intention is to provide a way for projects to
take list/array type arguments and validate that all of the elements in
that array are valid without using complex looping constructrs.
2017-11-29 14:14:41 -08:00
Nirbheek Chauhan 65edbf35ef dependencies: Use shlex to parse pkg-config cflags and libs
Escaping spaces with '\ ' is the only way that works with both
pkg-config and pkgconf, so quote that way and unquote inside Meson.
This should work on all platforms.

Also fix the unit test to do the same.

https://github.com/pkgconf/pkgconf/issues/153
2017-11-11 23:06:49 +05:30
Nirbheek Chauhan 4405a1297b dependencies: Add a test for static libs with pkg-config
Demonstrates that pkg-config does not prefer static libs over shared
libs even if we use the `static: true` kwarg.
2017-11-11 22:39:58 +05:30
Jussi Pakkanen a655b64989 Add an rpath entry to shared libraries that are linked from the source tree. 2017-09-30 18:21:02 +03:00
Jussi Pakkanen ac79eebc2f Moved prebuilt static library under unit tests. 2017-09-30 16:34:30 +03:00
Jussi Pakkanen b9c4fc728c Moved prebuilt object test under unittests. 2017-09-30 16:08:41 +03:00
Hristo Venev f2fc32069b Add test for get_option(b_xxx) on reconfigure. 2017-09-15 18:24:26 +01:00
Jussi Pakkanen 9361666bd8 Merge pull request #2236 from trhd/env
Fix a stack trace caused by environment variables in test setups.
2017-09-06 23:13:55 +03:00
Jussi Pakkanen 72a6683c6f Permit overriding find_program from the cross file. 2017-09-04 22:47:12 +03:00
Hemmo Nieminen 64950bd318 Add a regression test for test suites.
Ensure test setup environment variables can from now on be given also as
strings.
2017-09-01 01:47:41 +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 85a263a670 Failing test for -D dedupping. 2017-06-17 13:29:13 +03:00
Nirbheek Chauhan 1865425b4b tests/unit/8: Rename to 9 and add -l flags 2017-06-12 22:39:33 +05:30
Jussi Pakkanen 8244f4c6a6 Created unit test to ensure linker arguments from consecutive dependencies are kept in order. 2017-06-12 22:26:10 +05:30
Jussi Pakkanen 0e47e74a77 Do not obliterate old rpath because it might be used due to read only data sharing. Closes #1619. 2017-04-17 12:48:54 +03:00
Jussi Pakkanen 8b73d80792 Merge pull request #1457 from mesonbuild/overrides
Add MVP implementation of overriding options.
2017-04-03 23:31:32 +03:00
Jussi Pakkanen 1b81b32afb Add test for werror which is a boolean type. 2017-04-02 00:07:23 +03:00
Jussi Pakkanen 319398f074 Proxy object for overriding options transparently. 2017-04-02 00:07:23 +03:00
Nirbheek Chauhan 58131c0515 tests: Fix typo in unit test code
This project wasn't actually configured, so it was never noticed.
2017-03-27 11:25:22 +05:30
Nirbheek Chauhan 798c349e35 Fix compiler exelist in cross-info and the environment
https://github.com/mesonbuild/meson/pull/1406 had an incomplete fix
for this. The test case caught it.

Note: this still doesn't test that setting it in the cross-info works,
but it's the same codepath as via the environment so it should be ok.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan f90f17b250 unit tests: Test some corner-cases in test setups
https://github.com/mesonbuild/meson/pull/1402
2017-02-19 23:13:32 +05:30
Nirbheek Chauhan 4677f37366 tests: Move build-by-default unit test to common tests
Also add a test() that can be run on all platforms.

Currently unit tests are only run on Linux, so this was only testing the
Ninja backend. This change reveals that build-by-default was broken with
the Visual Studio backend.
2017-01-28 01:05:19 +05:30
Jussi Pakkanen 21d8505825 build_by_default it is. 2017-01-15 20:14:46 +02:00
Jussi Pakkanen db8ad2a4bd Add test for build_on_all. 2017-01-15 19:45:23 +02:00
Hemmo Nieminen 5833bd6735 tests: Add a test for new test suite selection. 2017-01-13 00:09:52 +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
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 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
Nirbheek Chauhan 18f581f2c4 Add an installed soname unit test
We also need to test that the sonames are correct after installation.
2016-12-22 01:32:02 +05:30
Jussi Pakkanen 07d7e87411 Allow soname to be an arbitrary string and fix symlink generation. 2016-11-26 22:16:05 +02:00
Jussi Pakkanen d651727208 Bootstrap test code with CMake. 2016-11-21 01:04:10 +02:00