Commit Graph

5871 Commits

Author SHA1 Message Date
Nirbheek Chauhan 9fdf4d83e6 pkgconfig dep: Special-case D link arguments
The D compiler does not implement find_library(), so we can't resolve
these libraries to absolute paths. Keep the old behaviour till that
can be done.
2018-06-20 11:27:08 +00:00
Nirbheek Chauhan 58ae2c9a8c Rename clike_langs to clink_langs for clarity
D is not a 'c-like' language, but it can link to C libraries. The same
might be true of Rust in the future and Go when we add support for it.

This contains no functionality changes.
2018-06-20 11:27:08 +00:00
Nirbheek Chauhan d737488150 dependencies: Don't assume self.compiler is a C compiler
All dependencies were using find_library, has_header, get_define, etc on
self.compiler assuming that it's a compiler that outputs and consumes
C-like libraries. This is not true for D (and in the future, for Rust)
since although they can consume C libraries, they do not use the
C ecosystem.

For such purposes, we now have self.clib_compiler. Nothing uses
self.compiler anymore as a result, and it has been removed.
2018-06-20 11:27:08 +00:00
Nirbheek Chauhan ebda6ef9c8 ninjabackend: Obvious typo, missing space
I checked the original commit, and that space should not be there.
2018-06-20 04:20:50 +00:00
Xavier Claessens 99dd5f34de Downgrade unknown option from exception to warning
It used to be non-fatal warnings but recent command line refactor made
it fatal. It looks like GNOME continuous would break with this change.
To avoid delaying upcoming 0.47.0 release adoption, let's downgrade this
back to warning for now and reconsider after the release.
2018-06-19 20:29:57 +00:00
Xavier Claessens 737f61792c gtkdoc: Fix dependencies not being built before invoking gtkdoc
In GLib when running "ninja gio-doc" without doing a full build first,
it won't build libraries and the generated gio-scan.c gets linked
against system libgio instead.

This fix 2 bugs: gtkdoc() was not passing 'depends' variable down to
_get_dependencies_flags(), and many places had 'if depends' which is
False when 'depends' is an empty list and not only when it's None. There
is no reason for that argument to be optional, we always want to collect
dependencies.
2018-06-19 12:06:43 +00:00
Corentin Noël 4aa848d5d6 Properly name the targets 2018-06-19 03:22:18 +00:00
Corentin Noël 59f87e5cd1 Add more tests to ensure no future regression 2018-06-19 03:22:18 +00:00
Corentin Noël b58f71cd73 gdbus_codegen: Keep the same behavior for all GLib versions
previous version duplicated the outputs disallowing to select only the .c files or the .h files
The docbook output files weren't listed too.
2018-06-19 03:22:18 +00:00
Corentin Noël 551f99ffff generate_gir: Add all the files provided by the CustomTarget 2018-06-18 12:00:28 +00:00
Jon Turney 5f5480f337 Make a custom target output dir as an include dir relative to @BUILD_ROOT@
Make a custom target output dir as an include dir relative to @BUILD_ROOT@,
so that path is constructed correctly when using the absolute path forms
used by the MSVC backend.
2018-06-18 10:52:21 +00:00
Jon Turney d17ce4ffd0 Correctly substitute the internal @BUILD_ROOT@ token with MSVC backend
To me, this looks like a mistake in 976c9abc, but perhaps there's something
I don't understand going on here.
2018-06-18 10:52:21 +00:00
Jon Turney 09c03a409b Test windows.compile_resource() when depends: is a custom_target
This test covers the case where the resource script references a file which
is created by a custom_target (in this case, an icon).

Put icon in a separate directory to ensure we excercise setting the include
path to the directory which contains it.
2018-06-18 10:52:21 +00:00
Jon Turney 7c4b8591b0 Make depends: of windows.compile_resources() include-able
Add the output directories for any custom target in depends: to the resource
compiler include path
2018-06-18 10:52:21 +00:00
Jon Turney c0f59399e4 Add a depends: keyword to windows.compile_resources()
Expose depends: from the custom_target this creates.
2018-06-18 10:52:21 +00:00
Nirbheek Chauhan c9a89027ac run_command: Add new kwarg 'capture'
capture: false means we won't try to read the stdout at all.

Closes https://github.com/mesonbuild/meson/issues/3364
2018-06-18 10:51:46 +00:00
Alex Hirsch cbe18e01e4 Deprecate `build_always`, add `build_always_stale`
Since `build_always` also adds a target to the set of default targets,
this option is marked deprecated in favour of the new option
`build_always_stale`.

`build_always_stale` *only* marks the target to be always considered out
of date, but does *not* add it to the set of default targets.

The old behaviour can still be achieved by combining
`build_always_stale` with `build_by_default`.

fixes #1942
2018-06-18 10:49:40 +00:00
Nirbheek Chauhan d7466066e4 meson_install: Don't add DESTDIR to install_name
This was added accidentally. Includes a test for it.

Also fix a rebase error. The variable was defined incorrectly and was
overwritten with the correct value immediately afterwards.
2018-06-18 09:57:18 +00:00
Christoph Behle 5ef38d880f Add missing stubs to Compiler.
Added missing stubs to class Compiler for the methods:
  * compute_int
  * has_members
  * has_type
  * symbols_have_underscore_prefix
2018-06-18 07:52:15 +00:00
Christoph Behle dbb3c05cf9 Add check for arguments of has_members.
Ensure that has_members has at least two arguments.
2018-06-18 07:52:15 +00:00
Christoph Behle 9e0397805e Use stub to report misuse of get_define
Instead of checking on the call site add a stub to Compiler which raises
an exception.
2018-06-18 07:52:15 +00:00
Christoph Behle 93b5a42ada Test if compiler supports get_define.
Raise an InterpreterError for a clean error message if get_define is not
supported by the compiler.
2018-06-18 07:52:15 +00:00
Nirbheek Chauhan d2d1a7c573 unittests: Assert that we have pkg-config on all CI
Our appveyor configuration provides pkg-config when building for
mingw, cygwin, msvc, etc.

Of course, people manually running the tests won't require pkg-config.
2018-06-18 06:33:23 +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 69f817b0e3 depfixer: Rewrite install_name for dylibs on install
The install name is used by consumers of the library to find the
library at runtime. If it's @rpath/libfoo.dylib, all consumers must
manually add the library path to RPATH, which is not what people
expect.

Almost everyone sets the library install name as the full path to the
library, and this is done at install time with install_name_tool.
2018-06-18 06:33:23 +00:00
Nirbheek Chauhan e3757e3d3c pkgconfig deps: Also resolve paths to shared libraries
This allows us to more aggressively de-dup them, and also sets RPATHs
to all libraries that are not in the system linker paths so that
binaries can be run uninstalled without any special steps.

These RPATHs will be wiped on install, so they do not affect
reproducible builds.

De-duping:
Fixes https://github.com/mesonbuild/meson/issues/2150
Fixes https://github.com/mesonbuild/meson/issues/2118
Fixes https://github.com/mesonbuild/meson/issues/3071

RPATHs:
Fixes https://github.com/mesonbuild/meson/issues/314
Fixes https://github.com/mesonbuild/meson/issues/2881

Also fixes the uninstalled usage portions of:
https://github.com/mesonbuild/meson/issues/3038
https://github.com/mesonbuild/meson/issues/3077
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
Mathieu Duponchelle 6e2ee24619 nasm test: use -no-pie (#3710)
We were hitting the problem described by:

https://stackoverflow.com/questions/43367427/32-bit-absolute-addresses-no-longer-allowed-in-x86-64-linux

See the first answer for a detailed explanation

Fixes https://github.com/mesonbuild/meson/issues/3707
2018-06-18 04:58:20 +00:00
Xavier Claessens e565945253 Add UserFeatureOption type
This is a special type of option to be passed to most 'required' keyword
arguments. It adds a 3rd state to the traditional boolean value to cause
those methods to always return not-found even if the dependency could be
found.

Since integrators doesn't want enabled features to be a surprise there
is a global option "auto_features" to enable or disable all
automatic features.
2018-06-18 04:57:32 +00:00
Kurtis Rader 5290f41f31 Report exit status or signal that killed the test
When a test fails due to a signal (e.g., SIGSEGV) it can be somewhat
mysterious why the test failed. Also, even when a test fails due to a
non-zero exit status it would help if the exit status was reported. This
augments the result string to include the non-zero exit status or
signal number and name.

Resolves #3642
2018-06-17 21:22:42 +03:00
Jussi Pakkanen 8014a42f57
Merge pull request #3715 from jon-turney/duplicate-rsrc-script-name
Use a unique name for windows resource compilation custom target
2018-06-17 17:28:09 +03:00
Jussi Pakkanen cd63ca9c19 Support Rust targets with more than one source file. Closes #3632. 2018-06-17 15:39:59 +03:00
Xavier Claessens c5cb65eb7c gtkdoc: Run gtkdoc-scangobj command from build directory
All paths in CFLAGS are relative to build_root, so current directory
must be there we invoking gtkdoc-scangobj.

Closes: #3379
2018-06-17 15:38:30 +03:00
Jon Turney 8d5361bb1d Wrap a line in a way that doesn't break link [skip ci] 2018-06-17 15:26:11 +03:00
Jon Turney 2cb6bb1cf9 Fix header level of pcap [skip ci] 2018-06-17 15:26:11 +03:00
Jon Turney 77d872a35e Improve documentation of case-(in)senstivity of dependency names [skip ci] 2018-06-17 15:26:11 +03:00
Christoph Behle b08902a60f Improved documentation.
Added entry to release notes.
Added note to documentation, regarding from which version on the
behavior is changed.
2018-06-12 00:14:54 +00:00
Christoph Behle f2622133e2 Improve test case.
Add empty string literal to concatenation test.
2018-06-12 00:14:54 +00:00
Christoph Behle 219fcfad14 Document change in reference manual. 2018-06-12 00:14:54 +00:00
Christoph Behle 47c3a26915 Always apply concatenate_string_literal.
get_define always applies concatenate_string_literal to its result.
Remove kwarg concatenate_string_literal from get_define.
2018-06-12 00:14:54 +00:00
Christoph Behle b19b714f37 Add tests for concatenate_string_literals 2018-06-12 00:14:54 +00:00
Christoph Behle 626b0bcb05 Make concatenate_string_literals static 2018-06-12 00:14:54 +00:00
Christoph Behle 40d121d33e get_define can concatenate string literals.
Added method concatenate_string_literals to CCompiler. Will concatenate
  string literals.
Added keyword argument 'concatenate_string_literals' to Compiler.get_define.
  If used will apply concatenate_string_literals to its return value.
2018-06-12 00:14:54 +00:00
Christoph Behle bbb893f39e Add test case for string literal concatenation. 2018-06-12 00:14:54 +00:00
Christoph Behle ce27dd3aee Revert change 2018-06-12 00:14:54 +00:00
Christoph Behle 8ef4216f01 Concatenate string literals in get_define
If get_define returns a list of string_literals concatenate them into
one string.
2018-06-12 00:14:54 +00:00
Jon Turney 4bc6b68bae Also test that the resource has the expected contents 2018-06-11 11:49:12 +01:00
Matthew Waters 4edec259ca modules/qt: check for un-suffixed moc,rcc,uic on windows
The windows Qt installer doesn't ship with suffixed versions of the qt
tools.
2018-06-10 23:55:21 +03:00
Niklas Claesson 14716ea90c Visual Studio: Implement startup project 2018-06-10 23:36:54 +03:00
Nirbheek Chauhan 26e11f5fd8 Add missing FeatureNew for libwmf dependency
Also add it to the release notes for the 0.44 release.

https://github.com/mesonbuild/meson/pull/3709#issuecomment-395738573
2018-06-10 23:26:07 +03:00