Commit Graph

8861 Commits

Author SHA1 Message Date
Jon Turney c3163040ae
Display filename cwd relative in warning location
Format the filename relative to cwd in a warning location.
2020-02-28 11:54:05 +00:00
Jon Turney 346b5c4be7
Store filename in node location
Warnings have a location node object (with subdir and lineno
attributes), which is passed as a location: kwarg to mlog.warning() and
formatted in _log_error().

Re-purpose the subdir attribute (path relative to the source root dir,
with an implied filename of 'meson.build'), which is stored into the
node by parser(), to contain a pathname.

(Properly I should rename 'subdir' -> 'file' everywhere, but that's a
lot of churn just to see if this works)

Notes:
The warning location node may also have a colno attribute, which is
currently ignored by _log_error().

We can't currently issue warnings with locations in meson_options.txt
because the filename isn't part of the location (as it's assumed to be
'meson.build).
2020-02-28 11:54:04 +00:00
Jon Turney 534a974da7
Adjust all the other places MesonException file attribute is set
A MesonException has file, lineno and colno attributes, which get
formatted as a location in mlog.exception().

The file attribute got changed from a path relative to the root source
directory to a pathname (absolute or relative to cwd) in one place in
commit b8fbbf59.  Adjust all the other places the file attribute is set
to match.

Also:
Setting MesonException.file seems to be missing in the case where Parser
returned a non-CodeBlockNode object.  Fortunately, that looks like it's
unreachable, but add it just in case.
2020-02-28 11:54:04 +00:00
Jon Turney 4895830c28
Fix typos in comments about type annotations 2020-02-28 11:54:03 +00:00
Jon Turney fa928e803b
Remove unused MesonException.get_msg_with_context()
After that, the only remaining user of get_error_location_string() is mlog,
so move that there.
2020-02-28 11:54:03 +00:00
Jon Turney 63d67e2042 Fix 'linuxlike/14 static dynamic linkage' test on Cygwin
Update the expected output from nm to match changes in binutils 2.34.
2020-02-27 16:33:21 -08:00
Jussi Pakkanen 0fbd09609f Clang-cl cross fix from Dale Curtis. Closes #5639. 2020-02-27 23:50:03 +02:00
Mathieu Duponchelle 852fa087db doc: fix link warnings 2020-02-27 09:35:14 -08:00
Dylan Baker 2b6531a09b
Fix python2 rename (#6703)
* unittests: fix finding python2 if the binary is named python2

Because of the way the python module works the simplicity of the test
function is no longer valid, we need to have and additional name
parameter to make the python module work, as it doesn't look for an
entry called "python2" or "python3", only "python"

* unittests: Don't make our python 2.x check debian specific

* unittests: On macOS the python2 binary is still called python
2020-02-27 01:05:46 +02:00
Adam Duskett 6ba034c37d mesonbuild/modules/gnome.py: Fix giscanner and gicompiler logic
Currently, giscanner and the gicompiler paths are only scanned via pkg-config
if they are first found in the host path.

Add a else statement to fix this oversite.
2020-02-26 11:49:34 -05:00
Adam Duskett f66b04b099 gobject-introspection: determine g-ir-scanner and g-ir-compiler paths from pkgconfig
Currently, meson hard codes the paths of these binaries which results in
cross-compiled environments to run the host versions of these tools.
However, GObject-introspection provides the appropriate paths to these
utilities via pkg-config

find_program is needed in the case g-i is built as a subproject. If
g-ir-scanner or g-ir-compiler are in the build or source directory use those.
If they aren't found in the source directory, use the results from pkg-config.
2020-02-25 20:16:44 -05:00
Nirbheek Chauhan 36b573822a
azure ci: Test x86 Visual Studio builds again, closes #6604
This was dropped when the VS2015 images were removed from Azure.
2020-02-25 23:06:29 +02:00
Jussi Pakkanen fb2b637bbb Typo fix. [skip ci] 2020-02-25 20:39:45 +02:00
Jussi Pakkanen 999376a347 Document the project policy on mixing build systems. [skip ci] 2020-02-25 20:28:28 +02:00
Dylan Baker a94d70711c
Merge pull request #6658 from michaelbadcrumble/clean_meson_init
Update minit.py
2020-02-24 15:28:40 -08:00
Michael Brockus 0f92e0c3fa
Update minit.py 2020-02-24 11:34:48 -08:00
Michael Brockus b12ba4b1bc
fixed issue with auto-detection failing 2020-02-24 11:26:51 -08:00
Michael Brockus c72de63b9b
use python set to tuple for checking members 2020-02-24 10:10:56 -08:00
Jussi Pakkanen 9c604320a0
Merge pull request #6637 from mesonbuild/nirbheek/implement-symbolextractor-windows
Implement symbolextractor on windows + some cleanups/fixes
2020-02-23 20:23:03 +02:00
Yann Dirson ee94cb6c15
cmake2meson fix if nesting (#6676) 2020-02-23 20:19:13 +02:00
Jussi Pakkanen 8bf937b012
Merge pull request #6602 from mensinda/depBoost
boost: System dependency rewrite
2020-02-23 14:05:25 +02:00
Jussi Pakkanen bacf063aae
Merge pull request #6635 from mensinda/cmOTMFix
cmake: Fix dependency loops in custom targets (fixes #6632)
2020-02-23 12:49:50 +02:00
adamjalkemo 00c9a7a430 Update Custom-build-targets.md
Use the declared variables infile and outfile
2020-02-23 05:03:23 +05:30
Nirbheek Chauhan 04e89d0867 symbolextractor: Add support for Cygwin 2020-02-22 06:49:34 +05:30
Nirbheek Chauhan cbd143844d symbolextractor: Add support for clang-cl
Requires the latest LLVm 9.0 release which implements the `-list`
argument to `llvm-lib` and ships with an implementation of `nm` called
`llvm-nm`.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan cace70c64e symbolextractor: Add a Windows implementation
Supports both MSVC and MinGW toolchains. Checks for MSVC first, then
falls back to MinGW.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 3320e13d91 unit tests: Add a test for the symbolchecker script
When a source file for a library is changed without adding new extern
symbols, only that library should be rebuilt. Nothing that uses it
should be relinked.

Along the way, also remove trailing `.` in all Ninja rule
descriptions. It's very confusing to see messages like:

```
Linking target mylib.dll.
```

It's confusing that the period at the end of that is not part of the
filename. Instead of removing that period manually in the tests (which
feels wrong!) just don't print it at all.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan b0061257c9 unit tests: Add a test for reconfigure causing no-op build
meson setup && ninja && touch meson.build && ninja

should only reconfigure but not cause anything to be rebuilt.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 225d842e4c unit tests: Make assertBuildNoOp check stricter
We also need to verify that no CustomBuild targets were rebuilt.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 26615ac422 unit tests: Skip if pkg-config is not found
Of course, this does not skip on the CI, but helps on Windows.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 5dcbf10a1b ninjabackend: Pass the import library to SHSYM
We actually use this while linking on Windows, and hence we need to
extract symbols from this file, and not the DLL.

However, we cannot pass it instead of the DLL because it's an optional
output of the compiler. It will not be written out at all if there are
no symbols in the DLL, and we cannot know that at configure time. This
means we cannot describe it as an output of any ninja target, or the
input of any ninja target. We must pass it as an argument without
semantic meaning.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 72c6cbd990 ninjabackend: Minor refactoring 2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 7f1d78f304 tests: Ensure that executable and library are named differently
On Windows, the basename is used to determine the name of the PDB
file. So for a project called myproject, we will create myproject.dll
and myproject.exe, both of which will have myproject.pdb. This is
a file collision. Instead, append `_test`, similar to the C# template.

Fixes AllPlatformTest.test_templates on MSVC. This became a hard error
when we started listing PDBs in the implicit outputs list of ninja
targets.

Do the same for a test that was making the same mistake.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan be486a2ec8 ninjabackend: List PDBs in output list for targets
This is more correct, and forces the target(s) to be rebuilt if the
PDB files are missing. Increases the minimum required Ninja to 1.7,
which is available in Ubuntu 16.04 under backports.

We can't do the same for import libraries, because it is impossible
for us to know at configure time whether or not an import library will
be generated for a given DLL.
2020-02-22 06:49:34 +05:30
Dylan Baker be9bff81a2 coredata: Fix search and replace mistake
A descriptive string had List replaced with T.List on accident.
2020-02-21 14:34:20 -05:00
Dylan Baker edb52e9003 coredata: Warn on reconfigure if PKG_CONFIG_PATH has changed
Fixes #6520
Fixes #5223
2020-02-21 14:34:20 -05:00
Jussi Pakkanen 33fbc548ab
Merge pull request #6668 from mesonbuild/nirbheek/strip-more-unused-linkerlike-args
macOS: Remove more unused linkerlike args
2020-02-21 17:03:08 +02:00
Nirbheek Chauhan 36b4dec262 macOS: Remove more unused linkerlike args
`-L` and `-headerpad_max_install_names` are both linker arguments that
are commonly passed in CFLAGS too.

Closes https://github.com/mesonbuild/meson/issues/6294
2020-02-21 05:45:34 +05:30
Dylan Baker 48f3e72493 linkers: Update the linker names to be more consistent
This makes two basic changes, 1 it moves the name of the linker into the
linker class, this should reduce the number of errors and typos, and
ensure that a linker always has one name. This then renames the linkers
to have more consistent names.

Posix/gnu linkers are called ld.<name>: ld.gold, ld.lld, ld.solaris.

Apple linkers are renamed ld64.
2020-02-21 05:15:25 +05:30
Dylan Baker 9e7cca1472 docs: Fix reference table for linker names
These are pretty much all over the place because I never intended them
to be exposed to the meson source language, they were meant just for
documentation.
2020-02-21 05:15:25 +05:30
Dylan Baker cd30216ce4 compilers/compilers: Fix get_linker_id
Which could raise an AttributeError when used on languages like Java and
C# that don't have separate compilers and linkers.
2020-02-21 05:15:25 +05:30
Nirbheek Chauhan 090eaac918 unit tests: Remove an unused variable 2020-02-21 05:08:55 +05:30
Nirbheek Chauhan 4597235f92 msubprojects: We return a string from git() now
Fixes https://github.com/mesonbuild/meson/issues/6651
2020-02-20 12:20:29 -05:00
Rohan Garg 73f03e6093 Introduce dataonly for the pkgconfig module
This allows users to disable writing out the inbuilt variables to
the pkg-config file as they might actualy not be required.

One reason to have this is for architecture-independent pkg-config
files in projects which also have architecture-dependent outputs.

For example : https://gitlab.freedesktop.org/wayland/weston/issues/269

Fixes #4011
2020-02-20 10:19:19 -05:00
Daniel Mensinger 96f5d4e455
boost: Updated tests 2020-02-20 13:38:45 +01:00
Daniel Mensinger 08224dafcb
boost: Rewrite the boost system dependency
This PR significantly improves the handling of the boost library
tags and also ensures that the found libraries are always compatible
(have the same ABI tag). The current setup can also be extended to
filter for additional features (static linking with the runtime, etc.).

Additionally, BOOST_ROOT is better supported (it is now guaranteed
that all found files belong to a single root directory).

Finally, boost.py is now fully annotated (and checked with mypy).
2020-02-20 13:38:20 +01:00
Daniel Mensinger 893c246550
boost: Rewrite boost_names.py generator 2020-02-20 13:38:20 +01:00
Daniel Mensinger 113ec96626
cmake: Fix relative paths for add_custom_{command,target}
Do this by tracking CMAKE_CURRENT_{SOURCE,BINARY}_DIR variables.
This is achieved by injecting CMake code with CMAKE_PROJECT_INCLUDE
and overriding some builtin functions with a wrapper that adds
additional trace information.
2020-02-20 11:16:37 +01:00
Michael 9edbaec2f4 make use of default project const 2020-02-19 19:04:03 -08:00
Michael ea93619092 make use of enums 2020-02-19 19:02:58 -08:00