Commit Graph

3887 Commits

Author SHA1 Message Date
Nirbheek Chauhan d23e6b34c7 Preserve -L -l pairings fetched from external deps
While adding link args for external deps, sometimes different
libraries come from different prefixes, and an older version of the
same library might be present in other prefixes and we don't want to
accidentally pick that up.

For example:

/usr/local/lib/libglib-2.0.so
/usr/local/lib/pkgconfig/glib-2.0.pc
/usr/local/lib/libz.so
/usr/local/lib/pkgconfig/zlib.pc
/home/mesonuser/.local/lib/libglib-2.0.so
/home/mesonuser/.local/lib/pkgconfig/glib-2.0.pc

PKG_CONFIG_PATH="/home/mesonuser/.local/lib/pkgconfig/:/usr/local/lib/pkgconfig/"

If a target uses `dependencies : [glib_dep, zlib_dep]`, it will end up
using /usr/local/lib/libglib-2.0.so instead of
/home/mesonuser/.local/lib/libglib-2.0.so despite using the pkg-config
file in /home/mesonuser/.local/lib/pkgconfig because we reorder the -L
flag and separate it from the -l flag.

With this change, external link arguments will be added to the
compiler list without de-dup or reordering.

Closes https://github.com/mesonbuild/meson/issues/1718
2017-06-12 20:55:19 +05:30
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
Jussi Pakkanen b8f02047be Merge pull request #1900 from centricular/abstract-extdeps
dependencies: Add a new class ExternalDependency
2017-06-11 14:49:52 +03:00
Nirbheek Chauhan 1e42241ef3 gnome: Don't assume that a C compiler is being used 2017-06-11 14:36:33 +05:30
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 868d85d2e5 tests: Make SDL2 compulsory now that it's in the CI image 2017-06-10 19:00:00 +05:30
Nirbheek Chauhan 9308a6d923 tests: Add Boost unit tests and project tests on Windows
Boost tests are disabled on Windows for now because the detection
is actually completely broken. Once that's fixed (after the release)
we can enable it again.
2017-06-10 18:55:50 +05:30
Nirbheek Chauhan 56462e1439 compilers: Fix build_unix_rpath_args indentation
No code changes
2017-06-10 14:11:55 +05:30
Nirbheek Chauhan c1e9c757eb tests: Increase dependencies coverage a bit more 2017-06-10 00:20:03 +05:30
Nirbheek Chauhan b6b3905325 vs: Sometimes WindowsSDKVersion is unset
https://ci.appveyor.com/project/jpakkane/meson/build/2871/job/ti4qpoptd5tk19sn
2017-06-09 20:25:27 +05:30
Nirbheek Chauhan 1300766429 vs: Always check VSINSTALLDIR in case VisualStudioVersion is unset
This happened on the CI, so it could happen on people's machines too:

https://ci.appveyor.com/project/jpakkane/meson/build/2870/job/p2n70hg01vp3dkgl
https://ci.appveyor.com/project/jpakkane/meson/build/2870/job/7ifh64mi1999guxt
2017-06-09 20:21:01 +05:30
Nirbheek Chauhan 38716f0fcb tests: Improve llvm dependency test coverage 2017-06-09 20:21:01 +05:30
Nirbheek Chauhan 3a33a8ef49 unit tests: Add class to generate failing tests
It is not feasible to test all failure modes by creating projects in
`test cases/failing` that would be an explosion of files, and that
mechanism is too coarse anyway. We have no way to ensure that the
expected error is being raised.

See FailureTests.test_dependency for an example.
2017-06-09 20:21:01 +05:30
Nirbheek Chauhan ed6a5abee8 find_library: link_args is always a list 2017-06-09 20:21:01 +05:30
Nirbheek Chauhan 627190faf3 Add an env var to force meson to print a backtrace
This is really useful when debugging test failures. Without a stack
trace, you have to grep the source code for the error message.

Also set this in run_tests.py.
2017-06-09 20:21:01 +05:30
Nirbheek Chauhan c4d7667675 ExtraFrameworkDependency: Don't set required
Otherwise we will never hit the informative DependencyException.
2017-06-09 20:21:01 +05:30
Nirbheek Chauhan 0b08d5aab5 Add a new test for SDL2, which didn't have one
Currently optional on all platforms.
2017-06-09 20:21:01 +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
Sam Thursfield 22cfd44221 Document that the gnome.generate_vapi() function can install the .vapi 2017-06-08 23:35:14 +03:00
Bug 1cc0dc1540 fix WarningLevel in vcxproj #1913
- VS 2010-2015 expect <WarningLevel> to be inside <ClCompile>
- WarningLevel now correctly reflects VisualStudioCCompiler.get_warn_args
2017-06-08 20:18:21 +03:00
Jussi Pakkanen 3ced977547 Merge pull request #1874 from rindeal/configure_file-capture
add `capture: true` ability to configure_file()
2017-06-08 17:33:08 +03:00
Jussi Pakkanen de1305c9e8 Do not use context managers. Because Windows. 2017-06-08 16:17:20 +03:00
Jan Chren (rindeal) bafc607ab1 Update reference manual and release notes 2017-06-07 23:51:20 +02:00
Jan Chren (rindeal) 61ac9a5348 add tests for `capture` in `configure_file()` 2017-06-07 23:51:17 +02:00
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
Jussi Pakkanen 4ed68e7934 Merge pull request #1866 from ebassi/mkdb-args
Add mkdb_args support to gnome.gtkdoc()
2017-06-07 21:01:49 +03:00
Emmanuele Bassi f0a32ced54 Document the mkdb_args argument for gnome.gtkdoc()
Include the newly added argument.
2017-06-07 18:17:20 +01:00
Adam C. Foltzer a53e44ad63 generalize the system include detection a bit
This should help when using a non-standard sysroot, common in cross-compiling
2017-06-07 20:11:34 +03:00
Jussi Pakkanen 7c03bfb463 Merged needs_exe_wrapper branch. 2017-06-07 20:09:43 +03:00
Tim Hutt b6dbb4ecc6 Improve user-defined function wording & link to FAQ 2017-06-07 20:03:14 +03:00
Tim 0e027c9616 Document that user-defined functions and methods are unsupported
Fixes #1870
2017-06-07 20:03:14 +03:00
Jussi Pakkanen f397db6db3 Merge pull request #1898 from centricular/fix-rpath-linking
Use absolute RPATHs while linking due to a binutils bug
2017-06-07 20:02:23 +03:00
Ting-Wei Lan 139152b0ef Update the list of possible llvm-config binaries
This commit syncs the list with gnome-builder, which updates its list
in https://bugzilla.gnome.org/show_bug.cgi?id=782296.

llvm-config40 is added becaue LLVM 4.0 becomes a stable release.
llvm-config-5.0 is added to the bottom of the list because it is still
a development snapshot (svn trunk).
2017-06-07 19:54:45 +03:00
Nirbheek Chauhan 198c2f2d55 unit tests: Skip tests if no readelf found 2017-06-05 13:20:04 +05:30
Nirbheek Chauhan 7c0d1242aa compilers: Only set -rpath-link on GNU ld and linuxlike
It's an invalid option with Apple ld and leads to a build error.
2017-06-05 05:06:00 +05:30
Nirbheek Chauhan 41f8f1a53b unit tests: Also check RUNPATH when fetching RPATH 2017-06-05 03:09:17 +05:30
Nirbheek Chauhan 264ce6c0bc Use absolute RPATHs while linking due to a binutils bug
Use -rpath-link with the absolute paths to the respective build dirs
to work around a binutils bug that causes $ORIGIN to not be used while
linking.

Includes a unit test that manually checks the RPATH value written out
to ensure that it uses $ORIGIN.

See: https://sourceware.org/bugzilla/show_bug.cgi?id=16936

Closes https://github.com/mesonbuild/meson/issues/1897
2017-06-05 02:19:46 +05:30
Nirbheek Chauhan d79bdb9b6b unit tests: Use only implementation of get_soname 2017-06-05 02:11:07 +05:30
Jussi Pakkanen 5311a274e3 A few typo fixes in the converter script. 2017-06-04 20:19:15 +03:00
Jussi Pakkanen 83e778118d Added more functions to the list of checks. 2017-06-04 14:14:14 +03:00
Jussi Pakkanen 62051626a5 Merge pull request #1545 from centricular/dont-link-recursively
Don't add dependencies recursively while linking
2017-06-04 14:07:27 +03:00
Alan 53e47d42f0 Set clang_type to CLANG_WIN on windows. 2017-06-03 23:45:59 +03:00
Jussi Pakkanen fb4ab84491 Use && to ensure failed test run is flagged properly. 2017-06-03 23:40:16 +03:00
Jussi Pakkanen cb9344cb8d Revert "gnome: Use --pkg to pass pkg-config cflags to g-ir-scanner"
This reverts commit 3a2e333f00.
2017-06-03 23:40:01 +03:00
Florian Müllner 3a2e333f00 gnome: Use --pkg to pass pkg-config cflags to g-ir-scanner
While g-ir-scanner's compatible -I and -D flags cover what most pkg-config
files use, there's no guarantee that files don't set anything more exotic
that conflicts with the tool's own options.

For a real world example, mozjs-38 has '-include some-header-file.h', which
translates to '--include nclude another-file-to-scan.h' for the scanner;
unless for some reason there's an 'nclude' GIR available on the system,
the target will thus fail.

Avoid this case by pointing g-ir-scanner to the correct pkg-config file
instead of passing any cflags directly.
2017-06-03 21:35:09 +03:00
Paulo Antonio Alvarez 73b0002793 compilers: Make CCompiler.find_library return value consistent
When the CCompiler.links method call in CCompiler.find_library fails,
find_library resorts to finding the library file itself. In this second
case, the return value is not a list, whereas if links suceeds, the
return value is a list. Make it so that find_library returns a list
in either case.
2017-06-03 21:32:01 +03:00
Rene Lopez 45cf4191cc Use correct gettext input file in test 2017-06-03 21:31:27 +03:00
Rene Lopez 94f46447bb Allow empty extra arguments in gettext script 2017-06-03 21:31:27 +03:00
Tim b54e1d29fe Add a note about multi-line statements by ending the line with \ 2017-06-03 21:30:30 +03:00
Jussi Pakkanen 3f6c55b9b3 Merge pull request #1857 from aradi/configure-subsval
Configure subsval
2017-06-03 21:29:01 +03:00